Reputation: 11
How can I get jQuery to throw an error when one of my selectors selects nothing?
Upvotes: 1
Views: 337
Reputation: 108482
I added an example on how to debug this here: jquery hides simple javascript errors
And here is a fiddle: http://jsfiddle.net/B4XQx/
Upvotes: 0
Reputation: 1
I've created an example with Wikipedia: http://jsfiddle.net/Lctjs/. I want the first line to throw an error because it selects nothing. The other two lines actually do something (there is actually an element with class id "content") but the first line doesn't select anything to operate and I'd like to know. Thanks!
Upvotes: 0