BILAL
BILAL

Reputation: 3

Server failed to load resource (404) what do I do?

I can't solve my server problem; could you help on this?

HTML:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <img src="" id="rainbow">

JavaScript:

<script>
        console.log('im trying to fetch a c# logo')
        fetch('download.png').then(response => {
            console.log(response)
        })
    </script>

Error message:

im trying to fetch a c# logo
fetch.html:44 Live reload enabled.
download.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)

Upvotes: 0

Views: 21367

Answers (1)

JueK3y
JueK3y

Reputation: 317

The 404 error belongs to the 4xx error category and indicates an error on the client's side.
A 404 error occurs when a file cannot be found.

How can you fix this?

  1. Check if the image is in the same path as your script / HTML file.
  2. Check the name and extension of the image / file. Has a typing error crept in?

Upvotes: 3

Related Questions