Iframe cross-domain, any workaround ?

Discussion in 'Programming' started by abdus, Jan 17, 2011.

  1. #1
    hi,
    I have a page with Iframe contains remote website .
    the user should browse the Iframe'd website and when he finish
    he goes out with the cursor and clicks some button outside the frame ( in the parent page)
    I only want the last URL he visited in the frame .

    I've tried with src attribute but looks like it doesn't update
    when the user go to another page in the frame

    I've seen some of the ideas to access Iframe nodes but seems that no one of them works with me .

    do I need to access the Iframe, I think it could be done with some ajax in some way

    any help is highly appreciated, 'cuz I searched a lot
    TIA
     
    abdus, Jan 17, 2011 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is done with javascript but if you send the variable back to the server without a full posting then it becomes Ajax.

    As long as they are staying within the same domain then document.getElementById('MyIFrame').contentWindow. location.href; should work.
     
    AstarothSolutions, Jan 17, 2011 IP
  3. abdus

    abdus Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    the URL will be used to set a link with javascript , I dont need to send back anything to server.
    the Iframe contains remote website so location.href gives an 'access denied' error as you know
     
    abdus, Jan 19, 2011 IP