Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logic Behind the Use of jQuery?

I have good understanding how javascript as well as jQuery can be used in the HTML file but logically one question is arisen.

When we want to embed javascript into HTML file, generally (not every time) we write this simple code in head part.

<script type="text/javascript"> ... </script>

And when we want to embed jQuery at that time the same peace of code

<script type="text/javascript"> ... </script>

How can we identify by seeing this line only, is it js code or jQuery code?

Can anyone brief me about this logic?

like image 861
Viral Shah Avatar asked Sep 28 '12 10:09

Viral Shah


People also ask

What is the point of using jQuery?

The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.

Why was jQuery created?

jQuery is a JavaScript library created to make it easier and simpler to write JavaScript and HTML. It works on most web browsers and was invented by John Resig. The first release was in January 2006 at BarCamp NYC.

Which is the primary benefit of using jQuery?

jQuery promotes simplicity With simple syntax and open coding standards, developers can shorten the time it takes to deploy an application or site.

What is so great about jQuery?

jQuery promotes simplicity: jQuery is easy to learn. It has simple code syntax. Developers can easily implement functionalities with jquery. Developers don't have to be experts in programming to start working in jQuery.


2 Answers

jQuery is just a Javascript script providing you, when you execute it before your own scripts, a few very useful functions.

When you're coding in jQuery, you're coding in Javascript.

This means of course that everything you do using jQuery could be done (sometimes with pain, especially if you're not experimented) in Vanilla Javascript.

Usually, you'll detect that a page is using the jQuery library by such an import in the head of the page :

<script type="text/javascript" src="jquery-ui-1.8.21.custom.min.js"></script>

but there is no guarantee as jQuery could be inlined in another script or loaded dynamically.

like image 145
Denys Séguret Avatar answered Oct 27 '22 08:10

Denys Séguret


jQuery is javascript

jQuery is simply a javascript library allowing you to carry out actions which require less code (because the jQuery code does the extra javascript work for you).

jQuery is a multi-browser JavaScript library designed to simplify the client-side scripting of HTML

Source: Wikipedia

like image 27
Curtis Avatar answered Oct 27 '22 08:10

Curtis