How does jQuery Migrate plugin look for old code? - javascript

Just a conceptual question. Does the migrate plugin search through the javascript files pulled in by the browser? Or does the migrate plugin only look through code that is being executed by the server?
I need to use the jquery migrate plugin to update my code to the latest version of jquery. I'm trying to replace all instances of code stripped away in previous version and replace it with the latest ones.

From jQuery migrate docs:
Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used.
That way you can spot and fix what otherwise would have been errors, until you no longer need jQuery Migrate and can remove it.
Does it look through your files? No. It only warns when deprecated methods have been called from within your code

Related

If jQuery is made up of JavaScript syntax at its core, why browser support was added explicitely for it?

On many places, I found that jQuery is made on top of JavaScript. So the browser that supports JavaScript would definitely support jQuery.
But the page on Wiki https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks#Browser_support suggests browser support was added at its specific version. I am also confused on the statement at https://en.wikipedia.org/wiki/JQuery#Browser_support
May be I am unnecessarily confused, but this is a bit causing me headache.
Can anyone please tell me about this?
JavaScript: It supports directly. we don't require to add any library file.
Jquery: While we are using jquery, we have to add jquery library file. Without library, browser won't understand jquery script. Each library version, covers new feature of browser. so based on broswer version, we can use specific version's jquery library.

Make website support older browsers jQuery calls

I'm a bit stuck here. I have a website that currently uses jQuery 2.1.4 only. I just figured out it won't support older browsers such as IE 6, 7 and 8. I use jQuery for many things in my website, which includes login system, live chat and some management functions.
Anyway, I was thinking of implementing jQuery 1.11.3 because it supports these browsers. Thing is, I don't really know where to start from because I don't think I simply add another script source for jQuery 1.11.3 and it shall fix it all, but I'm looking for a way to add it so I won't have to change all my functions or add special functions just for older browsers.
The only jQuery methods I use are $.ajax, $.when and $.then.
I don't think I simply add another script source for jQuery 1.11.3 and it shall fix it all
You just replace the existing script source with it.
The 2.1.x branch is just the 1.11 branch with all the slow compatibility code for old browsers removed. They are API compatible.

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?

How should one link to a jQuery library: always link to the latest library or not?

What happened is that we have a page that was previously working then all of sudden some scripts no longer work (for some reason). We figured out that we needed to use the latest jQuery library to fix the problem.
So we were thinking to just link to http://code.jquery.com/jquery-latest.min.js so that it's always updated.
However, we are also aware that if we will always use the latest jQuery library, the new version might cause some problems on other older scripts.
What is the best way to link the jQuery library then to minimize these types of issues?
Save the stable version of the library to your local/server and link to it. That's all.
It is a bad idea to link to http://code.jquery.com/jquery-latest.min.js
Jquery latest version always available in,
http://code.jquery.com/jquery-latest.js
For Latest Min Jquery, use
http://code.jquery.com/jquery-latest.min.js
To get latest jquery from other hosts, follow jquerylatest.com

How well does jQuery support backward compatibility?

We have had issues with Mootools not being very backward compatible specifically in the area of drag and drop functionality. I was wondering if anyone has had any similar problems with jQuery not being backward compatible. We are starting to use it quite heavily and are thinking about upgrading to a newer version to start using several plugins that require it. Will we have any issues if we get rid of the older version?
jQuery seems to be nicely backward compatible. I have been using it for more than a couple of years now through several versions of the core and have not had issues when upgrading except a few minor ones with some plugins. I would say that the core seems to be fine but if you're using a lot of plugins you might run into some problems (but these are usually easy to fix, or the new core has that functionality built in anyway so you can just drop them).
jQuery is so serious about backwards compatibility that they produce a "backwards compatibility" plugin for each release: http://docs.jquery.com/Release:jQuery_1.2#jQuery_1.1_Compatibility_Plugin. It let people who don't need backwards compatibility save on page weight.
My experience is that when upgrading, I sometimes find that stuff that used to work breaks. For instance, when upgrading from 1.7.2 to 1.8.3 I found some drag-and-drop features stopped working. Some problems may be due to deprecated jQuery functions being dropped, still in use by incompatible versions of jQuery UI.
Here is a quote from another user:
Backward compatibility may not be the jQuery team’s strong suit, but
as with most things, it’s a work in progress. I’m not meaning to
disparage the great work they do, but it points out the fact that you
simply must always test your scripts with new versions of jQuery.
jQuery has produced backwards compatibility plugins since version 1.0.
Web development has changed a lot over the years, and jQuery has changed along with it. Through all of this time, the team has tried to walk the line between maintaining compatibility with code from the past versus supporting the best web development practices of the present.
The project has the following backwards compatibility repos:
jquery-compat-1.0(Compatibility plugin for those upgrading to jQuery 1.1+ from jQuery 1.0)
jquery-compat-1.1(Compatibility plugin for those upgrading to jQuery 1.2+ from jQuery 1.1)
jquery-xpath(Implement XPath functionality for those upgrading to jQuery 1.2 from jQuery 1.1)
jquery-compat-1.3(Backwards compatibility plugin for jQuery 1.3 (to be used with jQuery 1.4))
jquery-migrate-1.x-stable(Migrate older jQuery code to jQuery 1.9+)
jquery-migrate(Migrate older jQuery code to jQuery 3.0+)
References
jQuery Blog
jQuery Wiki: Won't Fix
jQuery Core Upgrade Guides
jQuery Migrate Plugin - Warning Messages (2.0)
jQuery Migrate Plugin - Warning Messages (3.0)
jqLint
In my experience, jQuery 1.x has been very backwards-compatible until version 1.9.
The jQuery 1.x line had major changes as of jQuery 1.9.0. We strongly recommend that you also use the jQuery Migrate plugin if you are upgrading from pre-1.9 versions of jQuery or need to use plugins that haven't yet been updated. Read the jQuery 1.9 Upgrade Guide and the jQuery 1.9 release blog post for more information.
And don't upgrade to 2.0 until you're sure that this isn't an issue for you:
jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8.

Categories

Resources