Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why web browsers don't have jQuery built in? [duplicate]

Tags:

It seems like a good idea to me. or add the additional features to Javascript itself?

like image 238
Comma Avatar asked Jul 19 '10 07:07

Comma


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.

Does JavaScript work the same on every browser?

Each browser has a different version of Javascript, and some implement only certain features of each version. Here are the releases notes for IE9, that state javascript performs differently on IE8 and IE9. Here is a list of versions. Show activity on this post.

Is jQuery outdated?

The team announced that the cross-platform jQuery Mobile project under its umbrella will be fully deprecated as of October 7, 2021. New technologies for mobile app development have evolved since this project was launched in 2010, so we're encouraging developers to plan for this jQuery Mobile transition.

Why was jQuery so popular?

IT is the commonly the first library that JavaScript developers learn because: Its syntax for AJAX calls is very simple compared to the native XmlHttpRequest. It offers shorthand solutions to common JavaScript challenges, like sorting and filtering arrays. Many other libraries have jQuery dependencies.


4 Answers

Because it's just one library of many. It may be popular but it's far from being the only choice. And it would also cause it to freeze at a particular version and make improvements much slower.

Plus there is little advantage anyway. It's fairly small and you can set it to be cachable indefinably by the brower so it will only be downloaded once anyway - if you have a new version it will have a new filename, so there is no harm in making it never expire.

like image 163
jcoder Avatar answered Dec 27 '22 22:12

jcoder


I think this question should be a bigger discussion, but these answers are all bogus. This is also 2 years later of course.

  1. "it's just one library of many" - include the top 11 then.
  2. "couldn't agree on common standard" - Kind of making jQuery a standard of it's own at this point.
  3. "updated more often than browsers" or "make improvements slower" - So the browser won't have jQuery-1.9.x until next browser update, just don't put it in your project yet.
  4. "Cache anyway" - Sure, it's still a transfer that doesn't have to happen, and there are a lot of people that haven't done a lot of surfing on their new device that you still want your site fast for and so on.

The thing is it is totally doable and would be better for the internet load; by how much is debatable. I could really see chrome at least replacing any net transfer to their CDN with a local copy, but I'm sure there is some legal, security or net neutrality issues with that. Just like I'm sure the main reason has something more to do with such matters and not these lame technical excuses that are obviously not thought through.

This could benefit other libraries too if developers could rely on the speed and availability of a complete library of tools like dojo, and not have to pick and choose just to cut weight. And also as most libraries have adopted the AMD or requireJS approach to package their projects, I believe there is a good argument for the enabling the browser to at least be informed of it's dependencies.

like image 27
Dylan Avatar answered Dec 27 '22 20:12

Dylan


jQuery exists just because they (browser makers) couldn't agree on common standard.

like image 43
mbq Avatar answered Dec 27 '22 22:12

mbq


You can consider jQuery to be a JavaScript plug-in. And browsers do not ship with plug-ins, otherwise the purpose of plug-ins would be irrelevant.

like image 23
Prutswonder Avatar answered Dec 27 '22 22:12

Prutswonder