Bug Tracker

Ticket #3898 (closed bug: duplicate)

Opened 6 years ago

Last modified 5 years ago

jQuery 1.3 cross-domain iframe bug

Reported by: shadedecho Owned by: john
Priority: undecided Milestone: 1.3.1
Component: unfiled Version: 1.3
Keywords: iframe crossdomain Cc:
Blocking: Blocked by:

Description

I've run into a major problem with jQuery 1.3, but it is only happening with IE7 (not FF3). I have CompanionJS/DebugBar installed on IE, and it catches the errors. I've attached a screenshot showing the errors.

When I load the core library into an iframe with a different URL than the parent page, I get "Access is denied" and other javascript errors. Apparently, the jQuery object fails to get defined as part of the "Access..." error and then other errors cascade from that.

I've got a simple test which basically does nothing but load up the jQuery library into such an iframe. The exact same page can be accessed via two different domains, but the iframe is hardcoded to one of the two domains. So, when the parent page domain is the same as the iframe, jQuery loads fine. But when you create a cross-domain situation, errors ensue (no code changes, just different page domain).

 http://flxhr.flensed.com/code/dev-tests/test-jquery-iframe.html (works, because the domains match)

 http://www.flensed.com/code/dev-tests/test-jquery-iframe.html (fails with errors)

Attachments

jquery-iframe-errors.png Download (30.7 KB) - added by shadedecho 6 years ago.

Change History

Changed 6 years ago by shadedecho

comment:1 Changed 6 years ago by dmethvin

Your test page also fails in the same location on IE8 beta 2. Could you use the uncompressed jQuery 1.3 on those pages to see if that changes anything? At the very least it would make it easier to use the IE8 debugger. :-)

comment:2 Changed 6 years ago by dmethvin

  • Owner set to john

It appears that #3880 is reporting a potential fix for this test case.

comment:3 Changed 6 years ago by john

  • Status changed from new to closed
  • Resolution set to duplicate

Yeah, this looks like a duplicate of #3880. I'll apply the fix over there and hope it fixes the problem.

comment:4 Changed 6 years ago by shadedecho

I patched my copy of jQuery 1.3 (both the compressed and src versions) with the SVN6120 patch, and re-tested, and indeed the issue is resolved. Thanks for the quick fix!

Can/will this bug make it into the release notes or some other documented place so others that I have who I recommend for jQuery upgrade will know about this problem?

Note: See TracTickets for help on using tickets.