Hi guys before posting this, I've already gone and looked around many places trying to solve the problem but couldn't. This was the closest thing that I came across.
I am trying to dynamically create an iframe and load the content in to its src
then use the callback to do something to it. As always, everything works in FF/Chrome except in IE.
I have something like this:
var iframe = $('#helloworld');
if (!iframe.exists()) {
iframe = $('<iframe/>', {
id : 'helloworld',
src : "about:blank"
}).css({
width : "100%",
height : "100%"
});
}
...
iframe.load(options.src, function() {
div.append(this);
$(this).find('body').append(box);
box.dialog({
close: function( event, ui ) {
iframe.load("about:blank");
div.hide();
}
});
});
Similar to many other people's problem, it failed at the callback. From what I've read in other posts, it was due to invalid html coming back to the iframe, however, I've already checked that, and my html is valid.
This is what I am returning for my iframe, as you can see is already stripped to the bare minimum for testing purposes.
<!DOCTYPE html>
<html dir="ltr">
<head>
<title>Testing</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<style type="text/css">
</style>
</head>
<body></body>
</html>
In IE, the jQuery is dying @ line 5951:
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
SCRIPT65535: Unexpected call to method or property access. jquery-1.9.1.js, line 5951 character 5
Where this
is supposedly to be my iframe
, and it doesn't have appendChild
method.
Any hint for me to further troubleshoot this problem?