
simplemodal - issue #73
Iframe with SimpleModal keeps breaking down in IE with jQuery 1.6.2
SimpleModal or SimpleModal Contact Form (SMCF)? SimpleModal
Version of SimpleModal of SMCF (indicate Demo or WordPress plugin)? 1.4.1
Version of jQuery? 1.6.2
Browser/OS you are experiencing the problem with? WinXP, IE 8
I just upgraded jQuery to 1.6.2 and experienced SimpleModal breaking down IE8 (the browser!) when trying to load an iframe as modal dialog with an relative url. Absolute urls seem to work.
Comment #1
Posted on Sep 8, 2011 by Grumpy HippoI second that. Although my browser (IE9) is not crashing, what I'm experiencing sounds the same.
I have a page with jquery 1.6.3 and the latest simple modal script (1.4.1). My modal 'call' looks like:
$.modal('', { containerCss: { height: winHeight, width: winWidth }, zIndex: 10100, onClose: closeDetails });
Which opens up the modal window just fine. However, BookDetails.aspx does not contain a jquery reference, or any jquery reference for that matter. When I try to add the jquery reference I get a SCRIPT5009 javascript error. Most of the time it will say that 'Object is not defined' or 'Array is not defined'. The strange thing is that this will only happen when using IE9. It works fine under Chrome and Firefox.
It's fairly easy to try for yourself. Just open the Iframe demo you have on your own website (http://www.ericmmartin.com/projects/simplemodal/) and try the demo to open an external page in IE9...
Any thoughts?
Comment #2
Posted on Sep 12, 2011 by Grumpy CatComment deleted
Comment #3
Posted on Sep 12, 2011 by Grumpy CatI had the same issue too.... i think this issue is more to do with how IE9 handles iframe and subsequent loading of javascript in it... my workaround was to set iframe src only 'onShow' callback function and somehow i stopped getting those object undefined errors. Hope this helps.
function onShow(){ jQuery("iframe").attr("src", "/goto/site"); }
Comment #4
Posted on Sep 14, 2011 by Massive Rabbitupgraded to the latest version of jQuery (1.6.3) and the cursor just keeps spinning even though user is 'logged in'. same error using IE8 and latest Firefox on Mac. so i reverted to jQuery 1.4.2 and the problem is fixed.
Comment #5
Posted on Oct 15, 2011 by Grumpy HippoIt has been a while, but I thought I should post an update here. I found that the solution provided by dev.zav (comment #3) solved my issue as well.
In stead of setting the src attribute directly in the iframe, I now set it during the 'onShow' event. I no longer receive 'weird' JavaScript errors...
Thanks for the suggestion!
Comment #6
Posted on Oct 21, 2011 by Happy HorseComment deleted
Comment #7
Posted on Oct 21, 2011 by Massive MonkeyComment deleted
Comment #8
Posted on Oct 21, 2011 by Massive MonkeyI can confirm that dev.zav's comment #3 solved my issue too. My code ended up looking something like this:
$('.trigger-submodal').click(function (e) { e.preventDefault(); function setSrc(){ $('#iframeid').attr("src", "iframepage.php"); } $.modal('', { onShow: function(dialog) { setSrc(); } }); });
Thanks guys!
Status: New
Labels:
Type-Defect
Priority-Medium