Frames Cross-Domain issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartic
    New Member
    • May 2007
    • 150

    Frames Cross-Domain issue

    i have 3 frames on on the right and other on the left , the right frame submit data by java script,the left frame i need to get the current elements on the right frame by javascript i used this code :

    Code:
    var myIFrame = parent.document.getElementById(iFrameName);
    var theiframebody = (myIFrame.contentDocument)? myIFrame.contentDocument.body: myIFrame.Document.body;
    try{
    	alert(myIFrame.theiframebody.getElementById('element').value);
    }catch(e){
    	alert('error');
    }
    it give me an error permission is denied or access is denied , how can bypass this error and get the elements ?
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Have a look at this
    I think it may help you..

    Comment

    • smartic
      New Member
      • May 2007
      • 150

      #3
      this code he have control on both pages put i can't control one the frames?

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Then use a server-side proxy as suggested in one of the earlier posts, i.e. serve the page from the other domain from your server.

        Comment

        • smartic
          New Member
          • May 2007
          • 150

          #5
          i used Web Proxy for Cross-Domain put i have an error ( 405 not allowed nginx )

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            It usually means you're using the wrong method to access the page. How are you accessing the page? Are you posting to it?

            Comment

            Working...