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



Question:

This question already has an answer here:

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


Solution:1

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.


Solution:2

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.


Solution:3

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


Solution:4

Plugins get updated more often than browsers - within a week the browser version of jQuery would be out of date :)


Solution:5

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.


Solution:6

There's also the issue of versioning. Certain sites and extensions of jQuery require a certain version of jQuery. Right now it's up to the application to decide which version to use.


Solution:7

Probably because browsers are hard to update. Some freature of JQuery may eventually make their way into javascript, and I believe some of it has just recently. (well the idea's anyways) It takes years to add a feature to something like javascript, where the JQuery library can just release a new version.

There is actually a firebug or firefox plug in that allows you to inject JQuery into the page.. but thats just a development tool


Solution:8

Adding jQuery [type] functionality to the browser's in-built JS implementation (or making it a 1st-class plug-in) would overcome one basic problem:

As many have said, jQuery is a JS library - meaning, in case the penny didn't drop - that it is written in JS and has to be interpreted at run-time.

Embedding it would mean that it could be written in native code for the OS, making it much more performant.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »