I have a page with an iframe, and a button.
When you click the button I want it to capture the CURRENT location of the iframe.
If I use the iframe.src it will return the INITIAL location.
Does anyone know how I can get the current URL of the iframe.
Note: I have also tried
which gave me a permission denied error?
code:
When you click the button I want it to capture the CURRENT location of the iframe.
If I use the iframe.src it will return the INITIAL location.
Does anyone know how I can get the current URL of the iframe.
Note: I have also tried
Code:
document.getwebpage.location.href
code:
Code:
<html>
<head>
<title>Target Page Selector</title>
</head>
<body>
<center>
<table width="100%" height="100%">
<tr>
<td>Navigate to the page you want and click the select button</td>
</tr>
<tr>
<td align="center">
<iframe width="640" height="450" src="[URL unfurl="true"]http://www.google.com/"[/URL] name="getwebpage" id="getwebpage"></iframe>
</td>
</tr>
<tr>
<td align="center">
<input type="button" value="select" onclick="alert('url = ' + document.all.getwebpage.src)">
</td>
</tr>
</table>
</center>
</body>
</html>