Forum Moderators: open
When you include JavaScript into a page, whether by an "src" or by a direct implementation, the page becomes the scope and the context. Everything is on that page.
I depend on that for that AJAX library I PMed you.
There is the problem of not being able to access or use JS until it has been added to the page.
For example:
<html><head><title>Spaz</title></head><body><script type="text/javascript">var spaz='spaz';</script><script type="text/javascript">alert(spaz);</script></body></html> Will display "spaz," but:
<html><head><title>Spaz</title></head><body><script type="text/javascript">alert(spaz);</script><script type="text/javascript">var spaz='spaz';</script></body></html> Will give an error.
JS is a bit weird about being invoked as the page loads. I have gotten inconsistent results.
I tried in one script:
function myThing() {
stuff
}
and then in the other:
if( myThing) {
more stuff
}
But it didn't seem to work. Got a myThing undefined error. Should it work? I'll check the loading order thing and the onload handler again if it should.