7

Apparently missing) is fixed in jQuery: not (.class on everything except Safari?

 3 years ago
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.
neoserver,ios ssh client

Apparently missing) is fixed in jQuery: not (.class on everything except Safari?

advertisements

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

Hey all, I've got some hidden divs that are shown via a dynamic slideToggle function. Everything works great, but the divs are left shown when you click on other links. I'd like one div shown at a time. Clicking hides the others and shows the new one

Hide members of the class from everything except another specific assembly

I have two class libraries "MyLibrary.dll" and "MyLibraryEditor.dll" for a Unity runtime and editor extension. There are several class members inside "MyLibrary.dll" that are only intended for use by "MyLibraryEditor.dll

How to check (avoid) styling of nested html elements when using jQuery if classes are not an option?

I am working on implementing a dynamic styling functionality in a Wordpress theme using jQuery. I am challenged by the fact that jQuery uses inline styling, which can have the effect that nested elements may get targeted by a selector even though tha

Jquery datatable fixed columns do not line up in IE

If you check in IE 10 the fixed columns does not align with body rows whilst scrolling down, in chrome when you scroll right to bottom the fixed column does not align with the body. I have tried playing around with the following css, but its not work

Fix for jQuery divider in IE9

Update: This issue is with regards to multiple pane splitter which was working fine in all browsers except IE9. The widths for the right pane children do not resize accordingly upon window resize. (In the context of my application, I also had to put

Jquery not () in context

I am trying to make a drop down menu and want all other open menus to have a class removed when a different menu appears. the problem is, is that you have to click twice on a menu you previously clicked on to get it to open again: $(document).ready(f

Missing element of the jquery selector

This question already has an answer here: jQuery selector to target any class name (of multiple present) starting with a prefix? 4 answers I want to highlight any element that has a class that starts with a_slot_ but doesn't end with pink or green in

JQuery AJAX functions do not work in iOS 5 Safari / iPad

Using the latest version of jQuery 1.6 on iOS 5 safari from an iPad, I'm noticing that all my ajax calls are failing. These same ajax calls work as expected on all other browsers I've tried, and I'm pretty sure they were also working on iOS 4's versi

Skip variable with jQuery AJAX does not work in Firefox and Safari, works in Chrome

html <li><a class="download-link" href="<?php echo $path_data;?>">Download</a></li> ajax $(function(){ $('.download-link').click(function() { var wall_id = <?php echo $wall_id;?>; //store current wal

The jQuery .not () function does not work

I recently met a problem with .not() function, this is the code: var interval = setInterval(function() { $('.test').not('.updated').each(function(){ var $parentDiv = $('.test').parent('div'); // do something parentDiv.find('.test').addClass("updated&

How to fix this jquery function to work in IE?

I am relatively new with Javascript but managed to somehow get this code to work on chrome, firefox, safari but it doesn't properly on IE. First look at this code and then after that I will explain what seems to be not working: <!doctype html> <h

Why does jQuery not provide a .firstChild method?

I have seen plenty of discussion regarding the fastest way to select a first child element using jQuery. As can be expected, the native DOM firstChild property is much faster than using a jQuery selector or combination of selectors -- see http://jspe

Why does this jquery not load content via AJAX in IE8?

IE has astounded me again with it's amazing browser capabilities. This time assuring a lovely error in the jQuery.min file (google CDN) thus somehow causing my jquery not to load content via AJAX. Here's the link: http://themes.thefinishedbox.com/por

Browser test - Jquery not loading in IE8?

The URL: http://nomoresnoring.com/new/ What Browserstack.com says it looks like in IE9+ (nice!): http://www.browserstack.com/screenshots/1fa8063ad7510991811fbd280f61fd3f83a4ebf6/win7_ie_9.0.png And in IE8 and earlier (uh oh): http://www.browserstack.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK