Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selector warning not quite right. #2

Open
garbrand opened this issue Feb 2, 2011 · 0 comments
Open

Selector warning not quite right. #2

garbrand opened this issue Feb 2, 2011 · 0 comments

Comments

@garbrand
Copy link

garbrand commented Feb 2, 2011

Hey Menno,

I thought this message wasn't quite right:

Selector warning: a[href="#poi-10"]
There should be no need to prepend an ID selector with another selector. Use $("#poi") instead.

The selector picks up on 's that link to another anchor - in this case it does not have an id itself and so I guess the advice is misleading. $('#poi') does not select the same as $('a[href="#poi-10"]'), given the structure:

<a href="#poi-10">Go to POI 10</a>
<div id="poi-10">I am POI 10</div>

I realize it is a slooooow selector, so a message should be in order - how about:

Selector warning: a[href="#poi10"]
Selecting by specific attributes could be slow. Consider changing to a more specific selector such as a class or an id.

Bye!
Garbrand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant