Jump to content

Archived

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

Randy

Get the current URL of an iframe

Recommended Posts

I was wondering how I would get the current url of an iframe, I have searched on google but all to no avail.

Share this post


Link to post
Share on other sites
let's say the iframe id is "frm" you can access the URL by
[code]
document.getElementById('frm').contentWindow.location.href
[/code]

This only works if all the pages are on the same domain.

Share this post


Link to post
Share on other sites

×

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.