Possible to show an iframe's current location (current URL)

L

liketofindoutwhy

Let's say if I do an iframe... is it possible to show the current
location (current URL) of that iframe on the parent page if it has
navigated outside of my domain? (that is... if i iframe and set the
src to www.mywebsite.com, it seems that i can show the current URL of
that iframe as long as the user is navigating within mywebsite.com.
Once the user navigate outside of it, then i cannot show the iframe's
current location using

document.getElementById("an_iframe").contentWindow.location
or document.getElementById("an_iframe").contentWindow.location.href

hm... that's a bit strange, because it is just a URL.... and if i
navigate in the main browser window, the URL is always visible in the
browser's address bar, so why is there any security issue about it?)
 
T

Thomas 'PointedEars' Lahn

[...]
Once the user navigate outside of it, then i cannot show the iframe's
current location using

document.getElementById("an_iframe").contentWindow.location

WFM in Firefox 2.0.0.12.
or document.getElementById("an_iframe").contentWindow.location.href

That is not supposed to work in your situation because the `href' property
of Location objects is tainted by default as per JavaScript 1.3 and
therefore it is subject to the Same Origin Policy.

http://docs.sun.com/source/816-6408-10/location.htm#1193550


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top