javascript - Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: label - Stack Overflow

Good day,Hitting unsupported pseudo when upgrade jQuery to v1.12.4.Here is my jsp code:<label name=&

Good day,

Hitting unsupported pseudo when upgrade jQuery to v1.12.4.

Here is my jsp code:

<label name="role.label">maker</label>

And here is my jQuery code:

$(':label[name="role.label"]').show();

All these are working fine before I upgrade my jQuery. After I upgrade it, I am hitting Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: label.

Found that the solution is :

$('[name="role.label"]').show();

By remove the :label in front.

However, I have thousand of similar jQuery function, any other solution on this? Or this is the only solution?

Addition, there are some place that do not need to change, for example input:

$(':input[name="bankUserProfile.userGroup.role.name"]').val(data);

This one work either in old jQuery and v1.12.4.

Good day,

Hitting unsupported pseudo when upgrade jQuery to v1.12.4.

Here is my jsp code:

<label name="role.label">maker</label>

And here is my jQuery code:

$(':label[name="role.label"]').show();

All these are working fine before I upgrade my jQuery. After I upgrade it, I am hitting Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: label.

Found that the solution is :

$('[name="role.label"]').show();

By remove the :label in front.

However, I have thousand of similar jQuery function, any other solution on this? Or this is the only solution?

Addition, there are some place that do not need to change, for example input:

$(':input[name="bankUserProfile.userGroup.role.name"]').val(data);

This one work either in old jQuery and v1.12.4.

Share Improve this question asked Dec 19, 2016 at 2:35 Panadol ChongPanadol Chong 1,90316 gold badges66 silver badges140 bronze badges 1
  • Never seen that selector :label, are you sure it wasn't a custom extension? Can't really see why it would be of benefit over the tagname label either. :input however also includes <select> and <textarea> – charlietfl Commented Dec 19, 2016 at 2:45
Add a ment  | 

2 Answers 2

Reset to default 2

I would suggest just using the tagname for <label> and if there are attributes in selector keep those also

$('label[name="role.label"]').show();

beyond that you don't seem to have any other issues and can follow the documented pseudo selectors in the selectors api

Note that :label is not documented

I have encountered the same issue. Based on research, I went and remove label tag.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745038577a4607673.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信