inserting html into iframe evals scripts in parent context
Related to the new contents() function in jQuery 1.2, domManip doesn't have any idea that the HTML snippet you are inserting is going into an iframe on the page, and it evals any script tags in the parent context, not the iframe context. For example:
$.get("/some/page", function(h) {
$("iframe").contents().find("#remote").append(h)
})
If the html returned by the ajax request has any script tags, those will be eval'd in the full page even though the html is inserted into the iframe. This happens regardless of whether the html comes from an ajax request or whatever, of course.
Change History (5)
Component: |
core →
ajax
|
Status: |
new →
open
|
Milestone: |
1.2.1 →
1.5
|
Version: |
1.2 →
1.4.4
|
Keywords: |
ajaxrewrite added
|
Resolution: |
→ patchwelcome
|
Status: |
open →
closed
|
This is a close cousin of #3105, but with the twist regarding an iframe.