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)
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:
Share Improve this question edited Oct 21, 2023 at 14:54 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Mar 24, 2021 at 10:43 BILALBILAL 31 gold badge2 silver badges7 bronze badgesim 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)
1 Answer
Reset to default 3The 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?
- Check if the image is in the same path as your script / HTML file.
- Check the name and extension of the image / file. Has a typing error crept in?