I am testing an html webpage and it is failing to load a local jquery.json-2.4.0.js. I am testing the html page locally from chrome. When the page loaded I get a net::ERR_FILE_NOT_FOUND.
Why is it unable to load the file? This file has been moved from a different server (which it was working fine on), but the directory paths are the same (I double checked the path ).
Here is my line:
<script type='text/javascript' src='/webforms/ExperianEmailJsScripts/jquery/js/jquery.jsonp-2.4.0.js'></script>
This question is related to
javascript
jquery
html
json
Remove the first /
in the path. Also you don't need type="text/javascript"
anymore in HTML5.
I got the same error using:
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700,700i,900,900i" type="text/css" media="all">
But once I added https: in the beginning of the href the error disappeared.
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700,700i,900,900i" type="text/css" media="all">
Sometime when you downloading a project from other people, they might have some special customization. So, in my case I downloaded this project https://github.com/thecodercoder/fem-easybank
And got these errors: Failed to load resource: net::ERR_FILE_NOT_FOUND That happed because the creator was using the /dist folder customization.
https://youtu.be/aoQ6S1a32j8?t=309
SOLUTION: you open Notepad++ press: Ctrl + F for search find all folders that starts with / as in the picture and replace with norma ones like: /dist/ to dist
Same thing happened to me. Eventually my solution was to navigate to the repository using terminal (on mac) and create a new js file with a slightly different name. It linked immediately so i copied contents of original file to new one. You also might want to lose the first /
after src=
and use ""
.
Source: Stackoverflow.com