469,328 Members | 1,315 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Only functions in first included script are available after onLoad

Hi there. Has anyone experienced an intermittent problem where only functions
from the first included script tag are available to the onLoad event handler?
An example:

<html>
<head>
<script src="library1.js></script>
<script src="library2.js></script>
<script>
function doLoad()
{
functionCallFromLibrary2();
}
</script>
</head>
<body onLoad="doLoad();">
</body>
</html>

The script _ocassionally_ (once every 20 or 30 times, I would say) halts at
the functionCallFromLibrary2() with an Object Expected error. My debugger
tells me that, at this point in execution, all functions from library1.js are
defined and available but no functions from library2.js are available. Both
library1.js and library2.js are function libraries... there is no inline code
in either file.

Any insight? THANKS!!
-- Gene
Jul 20 '05 #1
1 2298
hi Gene,

Gene Goykhman wrote:
Hi there. Has anyone experienced an intermittent problem where only functions
from the first included script tag are available to the onLoad event handler?
An example:

<html>
<head>
<script src="library1.js></script>
<script src="library2.js></script>
<script>
function doLoad()
{
functionCallFromLibrary2();
}
</script>
</head>
<body onLoad="doLoad();">
</body>
</html>

The script _ocassionally_ (once every 20 or 30 times, I would say) halts at
the functionCallFromLibrary2() with an Object Expected error. My debugger
tells me that, at this point in execution, all functions from library1.js are
defined and available but no functions from library2.js are available. Both
library1.js and library2.js are function libraries... there is no inline code
in either file.

Any insight? THANKS!!
-- Gene


quick thought: try to call the doLoad-function from your both of your
external js-files (at the end) and modify the doLoad function like this

var counter=0;
function doLoad(){

if(++counter>1){
functionCallFromLibrary2();
}
}

lg

mord

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Da Costa Gomez | last post: by
3 posts views Thread by Disco-181 | last post: by
4 posts views Thread by Mark Hannon | last post: by
6 posts views Thread by Richard | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.