jQuery-IE未实现错误(在IE 8中) [英] Jquery - IE not implemented error (in IE 8)

查看:46
本文介绍了jQuery-IE未实现错误(在IE 8中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的IE未实现JavaScript错误,看来与本网站到目前为止我在阅读的内容无关.

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.

我正在使用jquery.simplemodal插件,除非我将doctype更改为

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"

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

IE将错误指向以下代码的第一行(我的意思是粗体的行):

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.removeExpression('width');

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

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

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

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

如何使用与doc不同的文档类型在IE中工作

How can I make it work in IE while using a doctype different from

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

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

(我想使用此文档类型

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

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

可在 http://lescracks.com/jquery.simplemodal.js . IE在第142行检测到错误.

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

谢谢

还有一件事情,在启用兼容性视图的情况下,它在IE中也可以正常工作.

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

推荐答案

.setExpression().removeExpression()是非标准方法.在IE8中,Microsoft删除了标准模式(XHTML doctype触发)对它们的支持,因为它们试图使浏览器更符合标准.

.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.

simplemodal的问题错误跟踪程序中的一个问题对此进行了讨论.显然,它已在1.4.1版中修复,但您正在使用1.2.2.他们一定已经停止依赖这些方法.您将需要升级.

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.

这篇关于jQuery-IE未实现错误(在IE 8中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆