Is $.browser absent from jquery-migrate? - javascript

I have to run someone else's old JS code which is using $.browser. I've search and found a lot of answers like "it's deprecated, use jquery-migrate". So I've included jquery-migrate, however $.browser doesn't seem to exists in that library.
Am I doing something wrong? is there anything special to have that object back
I'd prefer not to mess with the existing code since it's not mine.
TIA

After more digging I found there is actually 2 versions of the migrate library, using the "old" one helps keeping an old code running a little longer...

Related

How do I check which features of modern javascript( ES2015++, ES2018, ES2019) are implemented in the browser?

I was reading the proposal of ES2019 and I'm very interested to use the newly added features in this blog here. However I've been trying to search the reference of which browser has implemented which features but I can't seem to find it.
The closest I can get is to look at the javascript engine of each browser in wikipedia and go to the github repo but still there're not much information that I can get. I'm developing on react and have been using babel under the hood but it will be nice to understand the underlying implementation of most browser and why it is not implemented yet. Should we not care about that anymore because we have babel? Can anyone help me explain?
Cheers
You should care, even though Babel is a lifesaver.
I always check caniuse.com: https://caniuse.com/#feat=mdn-javascript_builtins_array_flat

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

Does Themeroller no longer support ui-checkboxes?

I downloaded the latest jQuery UI from their Themeroller site wanting to implement ui-checkboxes and cannot "seem" to find any reference or examples for it any longer.
Here is an online example of what I was hoping to implement
This is all I have found to be available (...and I hate this)
Did it go away?
And if so, why?
The version is I downloaded was jquery-ui-1.8.16 (I downloaded the entire thing). I searched all the CSS files with no mention of the tag ui-checkbox.
...it just struck me as odd.
According to that I have found, that particular plugin was broken past the 1.7.2 version of jquery, so it is broken. However, someone did make a version (not sure how compatible it is with the newest versions) that is compatible with 1.8.5. That can be found here
I don't think it's part of the official jquery-ui package. Is it this plugin?

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+ ....

Where do I get a list of javascript functions along with which browser it's supported in?

There are some JS functions that are IE specific. I am working on an application which has cross browser compatibility as a mandatory requirement. Before I use a JS function, I would like to know which browsers support it. Is there an online resource that can help me with this?
Look at quirksmode.org
You should consider buying his (PPK's) book (I am not on a commission), as it encourages you to use defensive coding with your javascript, so that you have code that detects objects, not browsers. This way of working changes the way you write javascript (even before you get to frameworks), so that the code is easier to maintain and develop.
Some of the other answers point to W3Schools, which has always been where I go to try stuff out when I'm working on front end stuff, it is very useful.
The other thing that I tend to do when I'm on a Javascript mission is to use Aptana for developing. This has some degree of intellisense that also indicates which mainstream browsers support the available functions. I think they still have a free version which will do the job in most cases.
Someone also mentioned that this question may be a duplicate, but sometimes the words used to ask the question make such a difference to how it is later found, even with the powerful searches we have available.
Hope this helps.
The spec is your friend. MDC is also quite useful.
http://www.w3schools.com/jsref
I would check http://www.w3schools.com/JS/default.asp

Categories

Resources