Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is jQuery not integrated within the browser

Tags:

Why isn't jQuery intergrated into browsers, so there would be no need to have to reference it on your site, and instead, the browser just notices the jQuery used, and everything works fine.

Even though referencing jQuery isn't that difficult, it stil would be a very cool feature to have. Thanks.

like image 639
H Bellamy Avatar asked Nov 27 '11 17:11

H Bellamy


People also ask

Is jQuery built into browsers?

No, jQuery is not built into browsers. Because if it were, you would be left with no support for new features in the older/outdated browsers. With cross-browser support in jQuery, it offers an external script that helps you obtain a new feature in its latest version.

Is jQuery built into JavaScript?

jQuery is a JavaScript library. It would not have been invented had JavaScript was not there. jQuery is still dependent on JavaScript as it has to be converted to JavaScript for the browser in-built JavaScript engine to interpret and run it.

Does jQuery work on Internet Explorer?

jQuery is only supported in Internet Explorer 9+, so if you're in an older version, you're out of luck perhaps, with a newer version. BUT... taken from the jQuery site... If you need to support older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use jQuery 1.12.

Which browser does not support JS?

Opera browser version 10.1 and Opera browser version 12.1 doesn't supports JAVASCRIPT let.


1 Answers

THE main advantage of having jQuery in an external script is that you can obtain a new feature in a new version of jQuery and (assuming jQuery did proper cross-browser support), you can automatically have that feature available in all the browsers your viewers use. You can code your site to use that new jQuery feature and know that it will work in all browsers in common use.

If jQuery functionality was built into the browser, you'd be stuck with a least common denominator approach. You could rely on no more features than were in the most backward browser or oldest browser that you wanted to be compatible with. When a new feature was introduced, you'd have to wait nearly a decade for all older browsers that don't support that new feature to drop out of common use before you could be sure it was safe to use. Or, you'd have to build your own cross-browser support for it, thus creating a new jQuery-like cross-browser library and the circle would start over again.

With jQuery, you just include the newest version of the library in your site and you can automatically use that new feature in all common browsers.

As for efficiency, you aren't losing much by including jQuery as an external file is it is done properly. If you use one of the more common CDNs (like Google) to link to jQuery, then jQuery is probably already in the browser cache and it's loaded from local hard disk rather than downloaded each time it's needed. Yes, it could be optimized further if it was built in, but then you lose all those benefits talked about earlier which negates the whole reason for having it in the first place.

Also, it's not like the built-in capabilities aren't moving forward every year. They are. It's called the standards movement. The issue is that it moves very slowly. Look at CSS3 transitions. We have CSS3 transition support today in all popular versions of Firefox, Chrome, Opera and Safari, but not in any version of IE yet. So, since we're still a long ways from all popular use of IE7, IE8 and IE9 disappearing, we're a long ways from being able to just "use" CSS3 and expect the browser to support it. An animation library is still needed. Even if IE10 shipped tomorrow and automatically supported all of CSS3 transitions, we'd still be many years away from when all older versions of IE stopped being used on the web.

like image 130
jfriend00 Avatar answered Dec 10 '22 16:12

jfriend00