Side navigation
#10950 closed bug (invalid)
Opened December 05, 2011 03:29PM UTC
Closed December 06, 2011 12:04AM UTC
Last modified December 06, 2011 07:46AM UTC
dynamic Iframe $.support
Reported by: | hafkensite@gmail.com | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | support | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I use jQuery to create an iframe, and with a "javascript:parent.init(document,window)" url get a reference to the document and window instances of the iframe. These are stored as iDocument and iWindow.
When I create elements for the iframe (from the outer frame), I use $("<div>",iDocument). This works as expected.
I have need to know if the iframe uses boxModel, so I want to use $.support.boxModel (the iframe may have a different doctype than the parent). Sadly this does not work on the iframe. This is because the support values are computed when jQuery is instantiated.
This would indicate that any method that uses support values to determine its working might fail because of different doctype or encoding in the other document.
Attachments (0)
Change History (3)
Changed December 05, 2011 03:57PM UTC by comment:1
Changed December 06, 2011 12:04AM UTC by comment:2
component: | unfiled → support |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
In order to run the support tests for the iframe, jQuery must be loaded in the iframe. The support tests only test the current document, which is intentional.
Changed December 06, 2011 07:46AM UTC by comment:3
What is the expected behavior if elements are created/accessed within a different context?
There is support for this, but I don't see how this would work correctly without running the support tests in the new context.
An example of the code can be found here:
http://jsfiddle.net/S9qya/15/
It seems that the different rendering modes provided by the Internet Explorer developer bar (IE9), do not work as expected. Because the two iframes always have the same boxmodel.
They do however change depending on the rendeing mode, while the support.boxModel value always is true.
With other IE versions this changes, but the problem remains.