window.location.href
Hi, I am doing window.location.href=<url> followed by an alert("hello") and then a document.getElementsByTagName('a'). It navigates to the url, but no alert box comes up and I am unable to get the elements on the new page. What is going on? Thanks.
|
The same as in the previous topic: the new page replaces the old one (and replacing includes deleting).
Plus, it would be a security hole to be able to access another website's elements. (Just think of net-banking: you don't want your private data stolen.) |
so how do i perform operations on the new page?
|
By adding javascript into the new page, obviously. If it someone else's page, then it is a good thing you cannot manipulate it from your code. (Read my prev post.)
|
All times are GMT -5. The time now is 10:36 AM. |