开发者

Jquery - IE not implemented error (in IE 8)

I am having an IE not implemented JavaScript error and it seems not to have anything to do with what ive been reading on so far on this website.

Im using jquery.simplemodal plugin which works fine in all browsers except IE unless I change the doctype to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

IE is pointing the error to the first line of the following code (I mean the line in bold):

s.removeExpression('height');

s.removeExpression('width');

s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');

s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');

How can I make it work in IE while u开发者_开发问答sing a doctype different from

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

(I would like to use this doctype

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">)

The plugin is available at http://lescracks.com/jquery.simplemodal.js . IE detects the error at line 142.

Thanks

One more thing, it also works fine in IE with the Compatibility view enabled.


.setExpression() and .removeExpression() are non-standard methods. In IE8 Microsoft removed support for them in standards mode (which the XHTML doctype triggers) because they were trying to make their browser more standards-compliant.

There's an issue in simplemodal's issue bug tracker discussing this. Apparently it has been fixed in version 1.4.1, but you're using 1.2.2. They must have stopped relying on these methods; you'll have to upgrade.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜