Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple Modal, jQuery 1.8.0 and IE9

Simple Modal fails with jQuery 1.8.0 and IE9 with the error:

SCRIPT438: Object doesn't support property or method 'removeExpression'

The following fiddle demonstrates (remember to run with IE9)

http://jsfiddle.net/ericjohannsen/ZVEWa/1/

Switching jQuery to 1.7.2 causes the error to go away.

Is there a way to work around this?

Possibly Related (OP says the issue was with jQuery 1.7.1 & iframes)

SimpleModal doesn't work in IE 9 (inside Iframe)

Unrelated (jQuery 1.5 issue)

Problems with simple modal in IE9

like image 372
Eric J. Avatar asked Aug 20 '12 22:08

Eric J.


3 Answers

Just to provide an updated answer (as of 8/2/2013), since I stumbled across this post while hunting down the very same bug...

As salgiza pointed out above in a comment, there's been a change in jQuery 1.10 that drops support for $.support.boxModel, which the latest version of Simple Modal uses.

To resolve this issue, you must change the following line in the Simple Modal source code:

        // (Line 239) $.support.boxModel is undefined if checked earlier
        //browser.ieQuirks = browser.msie && !$.support.boxModel;
        browser.ieQuirks = browser.msie && (document.compatMode === "BackCompat");
like image 187
nlh Avatar answered Nov 07 '22 03:11

nlh


It appears that the issue can be resolved by changing $.boxModel to $.support.boxModel. You can grab an updated version at http://github.com/ericmmartin/simplemodal.

I will try and get a fully packaged release, with min version, out shortly.

[edit] SimpleModal 1.4.3 has been released and should resolve this issue

like image 12
Eric Martin Avatar answered Nov 07 '22 04:11

Eric Martin


Had the same error as mentioned above 'Object doesn't support property or method 'removeExpression''. The modal window popped up in all browsers except IE. (Using non-minified version 1.4.3 of file jquery.simplemodal.js)

Fixed it by putting try {} catch (e) {} around all dynamic properties.

E.g.

try {
  s.removeExpression('top');
}
catch (e) {
  //The support for dynamic properties has been removed in Internet Explorer 9
}

The modal window shows in all browsers now.

like image 1
Koen Avatar answered Nov 07 '22 04:11

Koen