SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry URGENT - cross domain iframe

    HI

    I want to use a cross-domain iframe ( the content in the iframe is from my site, and customers will buy the right to use the iframe code on their sites ). The problem is that i have to pass some parameters to the parent window. This is not possible normally due to IE's security restrictions, but I made a P3P ( privacy policy file ) and now i can pass the parameters to the parent frame ( I actually change the parent's location to parent_url+ "?myparam=myvalue" ) ... The problem is that this only works on computers with Windows XP Service Pack 2 Installed ( thus on IE 6 SP2 )... Can someone give me some tips or some other solution that could make it work on other computers ? BASICALLY, ALL I NEED TO DO IS CHANGE THE PARENT FRAME LOCATION FROM WITHIN MY IFRAME!

    I tried:
    top.location=newlocation;
    top.location.href=newlocation;
    parent.location=newlocation;
    parent.location.href=newlocation;

    None of these work. They don't do anything and don't give errors. PLEASE HELP! IT IS URGENT!!!

  2. #2
    SitePoint Addict dek's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    window.parent.document.location.href
    Only dead fish go with the flow

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs down ...

    Hi

    Thanks for your reply, but that doesn't work ... I tried that. I don't have access to the parent document, because of security ( remember that the iframe is on a diffrent domain than it's parent ), so it gives me a JavaScript Access denied error. Look at http://ingenios.valmedia.biz/test.html

    Thanks

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't.

    The only way to get around that is to use a server-side script to copy the page from the second domain to your server.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


Bookmarks

Posting Permissions

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