Bug Tracker

Opened 8 years ago

Closed 8 years ago

#11431 closed bug (invalid)

Binding on events to iframe tags from parent window using "on" functions deleagate signature gives error in mozilla

Reported by: rogsmn@… Owned by: rogsmn@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

Error: Permission denied for <http://siteurl> to get property Attr.value Source File: http://siteurl/themes/general/js/jquery-1.7.1.min.js Line: 2

Description: I have a page with an iframe in it. iframe contains a link which when clicked opens a tinybox plugin displaying the contents of another page, but since the space available to iframe is limited so in order to use the full client width of the browser what i have done is that on the loading of iframe i am binding the links inside the iframe using the code given below

       if(sender.contentDocument)
            windowDocument = sender.contentDocument;
       else
            windowDocumet = sender.contentWindow.document;
       
       windowDocument.domain = document.domain;
       $(windowDocument.body).on("click",'.lnkdropbox',function(e){            
           TINY.box.show({iframe:'sitetobeopened',boxid:'frameless',width:$(window).width() - 50,height:$(window).height() - 50,fixed:false,maskid:'bluemask',maskopacity:40,closejs:function(){closeJS()}});
           e.preventDefault();
       });      

The above code is run when the iframes onload event is fired. This code runs well on IE and Google Chrome, but gives error on Mozilla.

On the contrary if i bind the iframes links using normal click event, it works fine on mozilla but then the functionality breaks on IE and google chrome

Change History (2)

comment:1 Changed 8 years ago by dmethvin

Owner: set to rogsmn@…
Status: newpending

I'm really surprised that works anywhere. You're setting the iframe's document.domain from the parent?

Your code clearly isn't executable since it has typos. Can you post a complete example on jsfiddle.net?

comment:2 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.