Simple Modal, jQuery 1.8.0 and IE9
Asked Answered
O

4

15

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

Outlawry answered 20/8, 2012 at 22:43 Comment(7)
Sounds more like a bug report than a question :PKabob
@StanislavPalatnik: The maintainer of Simple Modal says to report bugs on SO :-) ericmmartin.com/projects/simplemodal/#supportOutlawry
"The support for dynamic properties has been removed in Internet Explorer 9, so none of the getExpression, removeExpression, setExpression and recalc methods are supported. These methods exist in version 8, but using them raises exceptions." looks like some kind of regression issue, and is frustrating that the simplemodal author hasn't got a set of basic unit tests he runs on the main 3 browsers before releasingHest
@ChrisS.: Well, the last Simple Modal release was in 2010... Maybe he does have unit tests. Since there has been no activity on that project for almost 2 years, I'll probably have to switch to a different modal solution sooner or later.Outlawry
I've done the same and just switched to FancyBox (without many problems except styling)Hest
@ChrisS. this leads to the question of how to strip out or modify the Simple Modal plugin to not use the dynamic properties and still workPlaybook
Hi all - thanks for the comments. It appears that the issue can be resolved by changing $.boxModel to $.support.boxModel. You can grab updated versions at github.com/ericmmartin/simplemodal - I will try and get a fully packaged release out shortly.Vampire
V
12

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

Vampire answered 26/8, 2012 at 2:20 Comment(4)
Thanks Eric for all that you do! I was unable to get SimpleModal 1.4.3 to work with anything above jQuery 1.72 for IE9. It does work with jQuery 1.72. Anyone else experiencing the same issue? Would be great to have it work with the latest jQuery.Autolithography
Eric, $.support.boxModel has been removed from jQuery 1.10 bugs.jquery.com/ticket/13743 - As mentioned there, it can be replaced by checking document.compatMode === "BackCompat" (I had to do so in order to be able to use simplemodal with that jquery version)Corbicula
The same error occurred when using simplemodal 1.4.4 and jQuery 1.10.1.Taboo
@ericmartin: Did you see the answer from nlh? Were you able to make that change in Simple Modal?Outlawry
A
44

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");
Aboveboard answered 2/8, 2013 at 17:31 Comment(3)
It's a shame the plugin hasn't been updated. Thanks for providing the fix.Symploce
In the minified version I replaced !b.support.boxModel with (document.compatMode === "BackCompat") and it worked. Thanks a lot!Rolfston
This fixed the issue for me, using jQuery 1.10.2 and simplemodal 1.4.4 - thanks! These are the current versions as of September 2013.Underweight
V
12

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

Vampire answered 26/8, 2012 at 2:20 Comment(4)
Thanks Eric for all that you do! I was unable to get SimpleModal 1.4.3 to work with anything above jQuery 1.72 for IE9. It does work with jQuery 1.72. Anyone else experiencing the same issue? Would be great to have it work with the latest jQuery.Autolithography
Eric, $.support.boxModel has been removed from jQuery 1.10 bugs.jquery.com/ticket/13743 - As mentioned there, it can be replaced by checking document.compatMode === "BackCompat" (I had to do so in order to be able to use simplemodal with that jquery version)Corbicula
The same error occurred when using simplemodal 1.4.4 and jQuery 1.10.1.Taboo
@ericmartin: Did you see the answer from nlh? Were you able to make that change in Simple Modal?Outlawry
M
1

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.

Marinate answered 20/12, 2012 at 11:27 Comment(0)
S
0

The update suggested in the other answer didn't fix the problem. The error is due to the fact that removeExpression and setExpression aren't available in IE9. I fixed the issue on my site by commenting out anything that used either expression (I don't care about IE6–7 compatibility).

Spivey answered 5/9, 2012 at 1:22 Comment(1)
The update suggested in the other answer is from the author of Simple Modal. Might be worthwhile creating a new question that details your specific situation.Outlawry

© 2022 - 2024 — McMap. All rights reserved.