Home > OS >  Unable to Load Image in Chrome (Not allowed to load local resource:)
Unable to Load Image in Chrome (Not allowed to load local resource:)

Time:10-22

Test Browser: Version of Chrome: 94.0.4606.81

When I am running the html file it is not showing up instead showing error in console`

<!DOCTYPE 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>Image</title>
    <link rel="stylesheet" href="/Css/display.css">
</head>
<body>
    <div class="box1">
        <img src="C:\Users\first\OneDrive\Pictures\Downloaded Pictures\pexels-ella-olsson-1640777.jpg" alt="Cat Image"/>
    </div>
    <script src="/Js/function.js"></script>
</body>
</html>

Here's the Error Image

CodePudding user response:

You can't just load files from your local disk. You should take the files to the directory with your code and update the path.

  • Related