Results 1 to 3 of 3
Thread: External .js file won't load...
Oct 22, 2005, 08:07 #1
SOLVED -- External .js file won't load...
Very strange, I am pulling my hair...
Let me explain:
This is the simple version of my website structure
top | |__[JS folder] | |_____ main.js | |__[SUPPORT folder] | | | |___[JS folder] | | |_____ support.js | | | | | index.php | |__[SECURE folder] | | | |___[JS folder] | | |_____ secure.js | | | | | index.php index.php
In my secure index file (/secure/index.php), I have this:
Here comes the strange part:
In my support index file (/support/index.php), I have this:
- I am testing this in a local server, so file is there for sure.
- When I copy and paste functions in support.js into main.js, and point "SRC" to the main.js (../JS/main.js) it LOADS! and fuctions are working...
- It is between <HEAD> tags
- No I don't use any <SCRIPT> tags in .js files
- I am cleaning the cached files everytime I test.
I also searched the web, there are some similar questions and the answer is:
"HEY! it started to work suddenly, I didn't touch anything!"
Anyone can see anything wrong?
Thanks a bunch...
Last edited by BurakUeda; Oct 22, 2005 at 11:01.
Oct 22, 2005, 09:22 #2
Now this is funny.
I have restarted my pc, and now none of the .js files are loading.
This is something virtually impossible because I haven't touched the main index.php and secure/index.php for ages, and they worked fine without any problem. In the same environment, same PC, with same configuration, same firewall settings, same browser versions and settings etc. etc.
What is going on??
Oct 22, 2005, 11:15 #3
And it is solved at last.
I have found the problem but I still don't know what caused it.
Here is a bit detailed explanation of what happened, in case this may help someone:
So I suspected my php/html file which contains some onMouse... events, but they were allright.
I have removed the <SCRIPT SRC....> link, and the error has gone!
I have copied my main.js into support/JS/ directory, and renamed it to support.js. Erased everything in it, and re-coded the support.js functions. Voila! it worked!
Somehow my .js file was corrupted in a strange way. Because it was viewable and editable. And editing-overwriting didn't correct the file.
I just had to delete it an recreate it.
Maybe someone knows the reason?