Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascript error when using body as a selector in iframe #49

Closed
Krokador opened this issue May 29, 2012 · 3 comments
Closed

javascript error when using body as a selector in iframe #49

Krokador opened this issue May 29, 2012 · 3 comments

Comments

@Krokador
Copy link

I have a case where I have to use my body as the selector to declare the context menu on, which causes an error in the zindex function because my body is in an iframe. I fixed mine by changing this line:
if (!$tt || !$tt.length || $tt.prop('nodeName').toLowerCase() == 'body'
to
if (!$tt || !$tt.length || $tt.prop('nodeName').toLowerCase() == 'body' || $tt.prop('nodeName').toLowerCase() == 'html')

Figured I would let you know so you can test and/or incorporate the change to your next version :)

@rodneyrehm
Copy link
Contributor

Are you binding a menu from the parent document into the iframe? Is that common practice? What's the use case of that?

I replaced the test by !$tt || !$tt.length || "html body".indexOf($tt.prop('nodeName').toLowerCase()) > -1.

@Krokador
Copy link
Author

Our website uses jquery dialogs with iframes for certain data entry forms. I bind the context menu from within the page and it works fine if I view the page as a stand alone. From within the iframe though the zindex function keeps iterating to the parent until it hits the iframe and then it shoots me an "a.ownerDocument is null" error trying to find the z-index (using the latest version of Firefox with Firebug active)

Hope that helps

@rodneyrehm
Copy link
Contributor

Ok, should be fixed with version 1.5.16!

baohx2000 pushed a commit to Contatta/jQuery-contextMenu that referenced this issue Jun 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants