A
Andrew Poulos
In the head of my page I have:
<script type="text/javascript" src="scripts/test.js"></script>
and later in the head I have:
<script type="text/javascript">
window.onload = function() {
foo = 1;
};
</script>
If 'foo' is declared in test.js as
var foo = 0;
Will foo equal 1 when the page has finished loading? Or is the loading
of external javascript independent of when a page is counted as having
been loaded?
I'm going to be doing some DOM manipulation in the onload function so
I'm worried that if I instead trigger a function in the page from
test.js the function (in the page) might be ready but the page may not.
Andrew Poulos
<script type="text/javascript" src="scripts/test.js"></script>
and later in the head I have:
<script type="text/javascript">
window.onload = function() {
foo = 1;
};
</script>
If 'foo' is declared in test.js as
var foo = 0;
Will foo equal 1 when the page has finished loading? Or is the loading
of external javascript independent of when a page is counted as having
been loaded?
I'm going to be doing some DOM manipulation in the onload function so
I'm worried that if I instead trigger a function in the page from
test.js the function (in the page) might be ready but the page may not.
Andrew Poulos