now this is really weird:using that code, if you click the "check href" button first, you get an alert that says "about:blank" like it should, but if you click "change iframe" and allow google to load into the iframe, then click "check href", NOTHING. no alert, no nothing. How can i retrieve the location from the iframe after a page has been loaded into it?Code:<html> <head> <title>test</title> </head> <body> <iframe name="test_frame" width="600" height="300"></iframe><br /> <input type="button" value="change iframe" onclick="test_frame.location.href='http://google.com';" /> <input type="button" value="check href" onclick="alert(test_frame.location.href);" /> </body> </html>
This is confusing me because I've never really taken the time to learn javascript, and i guess this is why!![]()




Reply With Quote