View Full Version : Extracting values from iframe

05-12-2007, 02:14 AM

I've got a page which is setup as follows:

header stuff
body stuff


<INPUT TYPE="hidden" name="num" value="COMES FROM THE IFRAME">

The iframe has 3 hops which it redirects thru and then it lands at a page with the following type of URL http://www.thisisthefinalurl.com/?num=44548ds89

I need javascript to pull the num value of the final redirect page of the iframe and stick it into the value= parameter of my input...

Here's a real world example......


<INPUT TYPE="hidden" name="num" value="327dsdds32">

In that example here is what happened with example1.com ... it went to example2.com then landed at example3.com/?num=327dsdds32 ... when it was done redirecting the script will have retreived the num= value from the effective iframe url.

Please let me know if this is confusing and/or if you need clarification...

Thanks in advance for your time and help!!!

05-12-2007, 02:42 AM
Is it possible to extract the iframe's final URL as follows:

var currentUrl = top.iframe.location.href;


05-12-2007, 03:16 AM
Only if the url is on your own server. If its on a different server then no its not possible.