|
|
Q350 Why does the code continue to be interpreted even after I've requested that another document be loaded?
irt.org | Knowledge Base | JavaScript | General | Q350 [ previous next ] Q350 Why does the code continue to be interpreted even after I've requested that another document be loaded?If say you have code like:
Then what happens is that JavaScript changes the href property of a document object to a text string, the *browser* knows that this means "go get http://www.irt.org/' - so it does, but JavaScript doesn't know this, it just knows that it has changed the value of an objects property. The JavaScript code continues to be interpreted. To stop this from occurring do not have any JavaScript code after the request to load another document:
If however you need both to occur, i.e. load another document but also output text to the current document then swap the order around:
|
-- div -->
|