I have this code which sucessfully tracks the url as they change in the iframe:
<html>
<body>
<iframe src="start.php"></iframe>
<a href="#" onclick="alert(frames[0].location);">Get Link.</a>
</body>
</html>
When 'Get Link' is clicked on it shows the right link. When the user navigates inside the iframe to another page (on the same server), and 'Get Link' is clicked again, it displays the current iframe url.
But I need to get the iframe URL without having to 'click' something.
When I do this:
<html>
<body>
<iframe src="start.php"></iframe>
<script>alert(frames[0].location)</script>
</body>
</html>
The alert message says "about:blank"
How can I get the iframe location using 'frames[0].location' passed into a variable that can be read by the parent page without having to use the onclick function?