jQuery 1.9.1 unrecognised expression - javascript

I'm having a strange error between two versions of some software I'm working on and I wondered what might cause this behaviour difference in jQuery 1.9.1
I have a line that works fine in my stable release:
this.$el.find('input:[name=file].js-file-input-box').focus().click();
However I'm doing some changes to it and in the new version jQuery (still 1.9.1) throws an 'unrecognized expression' error.
Now I know it's down to the colon so if I change it to
this.$el.find('input[name=file].js-file-input-box').focus().click();
It works.
What might cause this to work / not work - I don't know which version is wrong!?

Related

Jquery git version

I'm using jquery git version (http://code.jquery.com/jquery-git.js) in my javascript and today when I opened the page, nothing works. It has worked for the last 3 years. Anyone else gets this? It looks like there has been updated at 2019-04-29T20:56Z. I know it unstable version, but is it I or anyone else also has this? When I use the 3.4 version, everything works fine. I'm using firefox and first error in console says TypeError: $.isArray is not a function[Learn More] and second
jQuery.Deferred exception: $(...).dialog is not a function #file:///C:/xxxx/xxx/xxx.js:20:19
mightThrow#http://code.jquery.com/jquery-git.js:3530:21
resolve/</process<#http://code.jquery.com/jquery-git.js:3598:12
undefined
Git version currently links to 4.0 pre, which is a large overhaul of jQuery to reflect updates to JavaScript. $.isArray was thus deprecated in 3.2, and consequently removed in 4.0, because JavaScript now has Array.isArray.
$.fn.dialog was never a part of jQuery that I know of (you might be thinking of jQuery UI?)

IntelliJ unresolved function or method with jQuery

I've been fighting with $ being marked as unresolved function or method when IntelliJ is doing it's analysis. I tried downloading the jQuery library as part of IntelliJ and set the scope to global, but it still doesn't work. I'm currently using jquery 12.1.6.
Is there a way to get IntelliJ to realize that the $ is defined globally?
The jQuery v1.11.0 shows exactly the same behaviour here as well. At the same time previous version 1.10.2 works fine in IDE (no warnings).
I think it has something to do with "AMD-fy jQuery source" ticket (http://bugs.jquery.com/ticket/14113) -- looks like IDE has some issues figuring out this style.
If you wish (and can) -- roll back to jQuery v1.10.2 (which is like half a year old, which means it's stable and still good to use).
Hopefully IDE will be able to properly parse this new jQuery style in next release.
Actual ticket: http://youtrack.jetbrains.com/issue/WEB-10908

Firefox warning message

I have a weird issue with firebug with my current javascript code
I have a web page with javascript and jQuery and I get this message:
use of getattributenodens is deprecated. use getattributens instead
I use jQuery 1.5.2 and Firefox 8, I get this error also on Windows 7 and XP. I tried mac also
I don't use getattributenodens in my code,
Who can fix this error? Thanks
Its just a warning, so developers can update their code with plenty of time.
You are a fair few versions behind in jQuery. If you upgrade to the current version (1.7.1), I think you will find this error message no longer exists.
Visit jQuery Website - http://www.jquery.com
Direct link to newest version — http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js

jQuery 1.7 is *still* returning the event.layerX and event.layerY error in Chrome

What am I doing wrong? Am I misunderstanding the problem or is it something else entirely?
On my page I was using jQuery 1.6.4 from the Google CDN. This would, of course, generate the error:
event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
I read here that jQuery 1.7 removed this issue. However, after updating my application to 1.7, I'm still seeing it. I'm using the Microsoft CDN until Google put the link up.
Things I've tried before posting this:
Clearing the browser cache
Changing back to jQuery 1.6.4 (still happens - obviously)
Using jQuery 1.7-specific code to make sure 1.7 is actually being loaded - .on() works fine when I use 1.7 but obviously gives undefined errors with 1.6.4 - I thought this should prove 1.7 is actually running
Commenting out and removing all other Javascript from my application - everything except for jQuery 1.7. Still triggers the error.
Any ideas?
Worked it out - it wasn't immediately obvious either, but posting this here for anyone who gets tripped up by this in future:
It was a Chrome Extension that used an old version of jQuery causing the issue. Disabling all Extensions and re-enabling one at a time helped me find the perpetrator. Hope this helps for anyone else with this issue in the future!

jQuery / Prototype conflict: only in webkit, in bookmarklet

I most likely have the same problem as in this question:
Weird Chrome prototype/jQuery conflict
Basically it appears Prototype is conflicting with jQuery in Safari and Chrome. The solution in the question was to include prototype first, however I can't do that: I'm using jQuery loaded in my bookmarklet, and so some sites it is used on will always have Prototype already loaded. Now let's ignore for the moment the wisdom of using jQuery in the bookmarklet. It seems to me there should be a solution here (though I can't find it), for these reasons:
1) This conflict does not appear to occur at all in Firefox.
2) Though the question linked to above cites a page stipulating that jQuery should be included first, I no longer find that reference there. So maybe it is not current?
Error Example: once jQuery is loaded (e.g. you can test it's version -1.4.4), if you try in the firebug console:
jQuery('p:')
#yields => []
#or
jQuery('p:first')
# yields => TypeError: Object #<an Object> has no method 'find'
Some other notes:
-I have tried noConflict(). This does not seem to work at all.
-I never refer to '$' in my code, but only use 'jQuery'
-Using jQuery from the Google CDN
-Moving all the bookmarklet code into a frame would be very difficult, if possible at all, so I'd rather not go there.
Thanks for your help!
I had to do this for a client project, and ran into the exact same issue. After some research it looks like the conflict doesn't exist in 1.4.2, but does in 1.4.3 (I'm not sure about later versions). I downgraded to 1.4.2 and my bookmarklet now works on pages with Prototype.
Third comment here:
http://forum.jquery.com/topic/jquery-conflicts-with-prototype-and-the-fix
I believe that this is now fixed in jquery 1.5+ ....

Categories

Resources