SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
-
Aug 2, 2001, 12:35 #1
- Join Date
- Apr 2000
- Location
- Long Beach, CA
- Posts
- 333
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
calling script via "src=xxx" method
Hey folks,
In hopes of keeping my code clean, I put all my javascript into separate files are are calling them via the "src=xxx.js" method.Code:<script language="JavaScript" src="/includes/script.js"></script> <script language="JavaScript1.2" src="/includes/fw_menu.js"></script> <script language="JavaScript1.2" src="/includes/scroll.js"></script>
Any ideas?
-
Aug 2, 2001, 13:44 #2
- Join Date
- Apr 2001
- Location
- Des Moines, IA
- Posts
- 346
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You shouldn't run into any problems, what sort of errors are you getting?
-
Aug 2, 2001, 13:48 #3
- Join Date
- Apr 2000
- Location
- Long Beach, CA
- Posts
- 333
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
well, what's happening is that when a page loads and the server happens to be slow at the particluar moment, then all javascript command on the navbar onMouseOver events cause errors, every object becomes undefined, etc.
check it out:
www.brainseeker.com/beta
I'm thinking that the server is just damn slow...
-
Aug 2, 2001, 13:52 #4
- Join Date
- Apr 2001
- Location
- Des Moines, IA
- Posts
- 346
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That server is slow and it looks like that is the problem. It looks like you'll have to either get a new host or include the javascript in each page.
-
Aug 2, 2001, 13:57 #5
- Join Date
- Apr 2000
- Location
- Long Beach, CA
- Posts
- 333
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
do you know if it'll work if I do an include file, e.g.,
Code:<!--#include file....-->
-
Aug 2, 2001, 13:59 #6
- Join Date
- Apr 2001
- Location
- Des Moines, IA
- Posts
- 346
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm not sure, but I think it will work. If you do try it you'll need to put the script tags in the include file. I think....I've never tried this before.
-
Aug 2, 2001, 15:29 #7
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey,
You could try covering up the errors, if that's the problem. THe code wouldn't work till it's loaded, but it would stop any errors from coming up:
<script>
window.onerror = new Function("return false");
</script>
aDogModerator at www.javascriptcity.com/forums/
-
Aug 2, 2001, 15:36 #8
- Join Date
- Apr 2000
- Location
- Long Beach, CA
- Posts
- 333
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks for the help.
I tried putting the js into an include file and it worked!! so that takes care of the problem since includes are always before client-side scripts...
But i'm coming across a weird problem. I have drop down menus, with a scrollable layer on the homepage. Only on certain computers running a specific resolution, a menu item on two of the menu don't work...
it's kinda hard to explain...so here's the url www.brainseeker.com/beta
Mouse over "company" and "career opportunities" and try to click on the first menu item of each...
It's a lot of javascript to sift thru and I don't expect anyone to do it for me, but if someone has any ideas of what problem it might be symptomatic of, I'd greatly appreciate it!
thanks again...
-
Aug 3, 2001, 18:01 #9
- Join Date
- Jul 2000
- Location
- Here
- Posts
- 1,010
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Maybe you could put all the code into 1 single JS file? I don't know if that would help or not.
Bookmarks