Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Extracting values from iframe

    Hello,

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

    <head>
    header stuff
    </head>
    <body>
    body stuff

    <iframe>http://www.redirects3hopstofinalurl.com</iframe>

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

    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......


    <iframe>http://www.example1.com</iframe>

    <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!!!

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is it possible to extract the iframe's final URL as follows:

    var currentUrl = top.iframe.location.href;

    ??

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Only if the url is on your own server. If its on a different server then no its not possible.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •