jquery - IE 8问题: unrecognized expression: first-of-type

标签 jquery internet-explorer internet-explorer-8

当我加载页面时,在 IE 8 中读取此错误:

Agente utente: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E) Timestamp: Fri, 27 Apr 2012 18:38:27 UTC

Messaggio: Syntax error, unrecognized expression: first-of-type Linea: 3 Carattere: 14659 Codice: 0 URI: http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js

在 Firefox、Chrome 和其他浏览器中都可以!

最佳答案

:first-of-type 不是 jQuery 选择器。 :first-of-type 仅适用于 native 支持此选择器的浏览器。

对于其他浏览器,扩展选择器集 ($.expr[':'])。看看this projectjquery-extra-selectors.js添加了对多个伪类选择器的支持。

关于jquery - IE 8问题: unrecognized expression: first-of-type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10357670/

相关文章:

javascript - 如何将 Instagram 图片整合到 slider 中?

javascript - 在事件选项卡中加载 Morris.js 图表( Bootstrap )

javascript - 使用 Javascript 提交表单并使用 ajaxForm 处理

html - 如何在 Firefox 和 IE 中使用键盘导航跳过隐藏的单选选项?

javascript - 在 Internet Explorer 中加载网页时出现 "Operation aborted"错误消息

css - IE8 与 IE8 兼容模式插入边框 CSS 问题

jquery、jsonp 没有成功

css - Flexbox、最小高度、边距自动和 Internet Explorer

ssl - 无法在 IE 8 上使用 https 下载 XLS 文件,但可以在其他浏览器上正常工作

internet-explorer-8 - 为什么 ie8 在刷新时会在几分之一秒内闪烁白色背景?