Apparently missing) is fixed in jQuery: not (.class on everything except Safari?
source link: https://www.codesd.com/item/apparently-missing-is-fixed-in-jquery-not-class-on-everything-except-safari.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Apparently missing) is fixed in jQuery: not (.class on everything except Safari?
I had a jQuery Syntax-Error in my Script but only Safari throw an exception.
$("#id:not(.class").length
The :not wasn't closed by ). In Safari length was 0, in all other browser it was the correct value if the error hadnt exist. Could it possible that Chrome, Firefox, Opera, Internet Explorer fixes these errors on the fly?
This is really somehow fascinating because I have asked myself this a lot of times, too, without further investigation why that is. Chrome indeed sometimes "ignores" syntax errors, for example when you add or leave out ;
or ,
in object notations for instance.
That can be a good thing but is sometimes hard to debug. Older browsers like IE throw errors where newer browsers dont. I dont know if this is a feature or a bug :)
I dont have sources on this but I can confirm that I noticed similar behavior. Most likely this has something to do with JavaScipt's strict mode.
Related Articles
JQuery not: (this) exclude everything from a class except the one called in a previous function
Hide members of the class from everything except another specific assembly
How to check (avoid) styling of nested html elements when using jQuery if classes are not an option?
Jquery datatable fixed columns do not line up in IE
Fix for jQuery divider in IE9
Jquery not () in context
Missing element of the jquery selector
JQuery AJAX functions do not work in iOS 5 Safari / iPad
Skip variable with jQuery AJAX does not work in Firefox and Safari, works in Chrome
The jQuery .not () function does not work
How to fix this jquery function to work in IE?
Why does jQuery not provide a .firstChild method?
Why does this jquery not load content via AJAX in IE8?
Browser test - Jquery not loading in IE8?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK