javascript - Why does this resource fail to load yet Jquery loads fine -


receiving following error when try add javascript file in directory:

failed load resource: server responded status of 404 (not found)

the resource it's failing load file called: formlogic.js

form.html, in root directory.

<!doctype html> <html> <head> <script src="js/jquery-1.11.0.min.js"></script> </head> <body>  <p>if click on me, disappear.</p>  <script src="js/formlogic.js"></script> </body> </html> 

both jquery js file , formlogic file in directory js formlogic.js fails load jquery loads fine. loads resource when move formlogic.js root directory , change script tag.

<script src="formlogic.js"></script> 

i don't understand why it's unable load directory yet can load jquery file.

formlogic.js contents:

$(document).ready(function(){     $("p").click(function(){         $(this).hide();     }); }); 

maybe it's because of relative path!? have tried use absolute path?

<script src="/js/formlogic.js"></script> 

take care of beginning slash. within projects try use avoid relative path errors.

if doesn't help, please tell me application structure , document root is.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -