can you get the URL being navigated to (inside a frame)

J

jojoba

Hi all,

Im running ie7.
I've got a page with an iframe in it.
The iframe starts at any real url.
When the user navigates that frame elsewhere (via click, form entry,
whatever) i would like to check the new url before letting the frame
completely load that new url.
I can tell when the frame is loading (using readyState), or by using
frame.document.onunload, but i still dont know how to get that pesky
url-being-navigated to, once i'm in that intermediate "loading" state.
(Hell, i even tried checking the status bar too!)

Any ideas,
thanks to all
jojoba
 
M

Merennulli

Hi all,

Im running ie7.
I've got a page with an iframe in it.
The iframe starts at any real url.
When the user navigates that frame elsewhere (via click, form entry,
whatever) i would like to check the new url before letting the frame
completely load that new url.
I can tell when the frame is loading (using readyState), or by using
frame.document.onunload, but i still dont know how to get that pesky
url-being-navigated to, once i'm in that intermediate "loading" state.
(Hell, i even tried checking the status bar too!)

Any ideas,
thanks to all
jojoba

As with many things in Javascript, this runs into a security wall. To
avoid pages tracking your clicks in an unfriendly manner, the major
browsers have taken away the ability to catch those URL's that a frame
navigates to. Older browsers you can get around this with use of the
frame.history or frame.location objects inconsistently, but to do this
consistently, you need to have the iframe load a filtering page you
control that reads and parses everything, changing all links to pass
through itself as well.
 
J

jojoba

As with many things in Javascript, this runs into a security wall. To
avoid pages tracking your clicks in an unfriendly manner, the major
browsers have taken away the ability to catch those URL's that a frame
navigates to. Older browsers you can get around this with use of the
frame.history or frame.location objects inconsistently, but to do this
consistently, you need to have the iframe load a filtering page you
control that reads and parses everything, changing all links to pass
through itself as well.- Hide quoted text -

- Show quoted text -

yeah...thats a bummer
damn...i thought there might be some way to do this
so sad
thank you anyways,
jojoba
 
D

dhtmlkitchen

Hi all,

Im running ie7.
I've got a page with an iframe in it.
The iframe starts at any real url.
When the user navigates that frame elsewhere (via click, form entry,
whatever) i would like to check the new url before letting the frame
completely load that new url.

You might be able to use onpropertychange event for the src attribute.
(see msdn)

I have never tried this, so maybe someone else can comment on that.
Seems like it would work.
I can tell when the frame is loading (using readyState), or by using
frame.document.onunload, but i still dont know how to get that pesky
url-being-navigated to, once i'm in that intermediate "loading" state.
(Hell, i even tried checking the status bar too!)

If it's all on the same domain, you can probably use on onbeforeunload
for the iframe's contentWindow. (see msdn)

Garrett
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top