Failed to Load Resource: Net: :Err_File_Not_Found Loading Json. Js

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>
2

Remove the first / in the path. Also you don't need type="text/javascript" anymore in HTML5.

8

This error means that file was not found. Either path is wrong or file is not present where you want it to be. Try to access it by entering source address in your browser to check if it really is there. Browse the directories on server to ensure the path is correct. You may even copy and paste the relative path to be certain it is alright.

2

I got the same error using:

<link rel="stylesheet" href="//" type="text/css" media="all">

But once I added https: in the beginning of the href the error disappeared.

<link rel="stylesheet" href="" type="text/css" media="all">

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 "".

Sometime when you downloading a project from other people, they might have some special customization. So, in my case I downloaded this project

And got these errors: Failed to load resource: net::ERR_FILE_NOT_FOUND That happed because the creator was using the /dist folder customization.

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

0

Instead of:

path.join(__dirname, '/dcp-electron/index.html')

you should add a dot at the start of the path, to indicate that the path is relative:

path.join(__dirname, './dcp-electron/index.html')

this can happen when you have the base tag, as explained in other answers

 <base href="/">
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest