Jump to content

get the url of an external website in frame?


MDanz

Recommended Posts

You would need JavaScript. Here's an example:

 

<script language="text/javascript">
function getFrameURL(id) {
    return document.getElementById(id).location.href;
}
window.onload = function() {
    alert(getFrameUrl("example"));
}
</script>
<iframe src="blah.html" id="example"></iframe>

 

This code is untested, just so you know.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.