最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Problems upgrading jquery 1.4.2 to 1.5.1 - Stack Overflow

programmeradmin6浏览0评论

I'm trying to upgrade from jquery 1.4.2 to 1.5.1 and I'm getting the following error:

Uncaught Syntax error, unrecognized expression: [rel*=address:]

I can't figure out what it's related to. Any ideas?

I'm trying to upgrade from jquery 1.4.2 to 1.5.1 and I'm getting the following error:

Uncaught Syntax error, unrecognized expression: [rel*=address:]

I can't figure out what it's related to. Any ideas?

Share Improve this question edited Jul 24, 2011 at 23:31 Lightness Races in Orbit 386k77 gold badges666 silver badges1.1k bronze badges asked Jul 24, 2011 at 23:07 LorenzLorenz 7751 gold badge7 silver badges28 bronze badges 0
Add a ment  | 

3 Answers 3

Reset to default 11

attribute selector needs to be enclosed by quote "

i.e. [rel*="address:"]

I think you have to escape the colon in the attribute:

If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[]^`{|}~ ) as a literal part of a name, you must escape the character with two backslashes: \. For example, if you have an element with id="foo.bar", you can use the selector $("#foo\.bar"). http://api.jquery./category/selectors/

Earlier versions of jquery seemed to be more forgiving

It may be that jQuery 1.4.2 just so happened to accept your invalid expression, but the correct expression is:

[rel*="address:"]

This is why it's very important that you read the documentation and use the correct syntax, regardless of whether or not your broken code "appears to work".

发布评论

评论列表(0)

  1. 暂无评论