Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between jquery and $

Tags:

jquery

I did heavy use of jquery on my php project. But on some page the $ is not working, so I have to use jquery. For example:

jQuery('#mycarousel').jcarousel({
start: 3
});

Can anybody please tell me what is the difference between $ and jquery?

like image 651
Himanshu Pandey Avatar asked Mar 26 '13 07:03

Himanshu Pandey


People also ask

What is the difference between jQuery and?

JavaScript is an independent language and can exist on its own. 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.

What is difference between Ajax and jQuery?

AJAX is a web development technique for making asynchronous calls to the server. jQuery is a JavaScript library for designing and make some web development tasks easy. It makes it possible to run javascript outside of the browser. It works on the browser or outside the browser also.

What is the difference between jQuery min JS and jQuery js?

min. js is a compressed version of jquery. js (whitespaces and comments stripped out, shorter variable names, ...) in order to preserve bandwidth. In terms of functionality they are absolutely the same.


2 Answers

when .noConflict() is called, selector like $('') is no longer working to ensure compatibility with other framework such as Prototype. at that time jQuery('') is used instead.

Reference: jQuery.noConflict()

To better illustrate the idea, here is an example obtained from the reference link:

<script type="text/javascript">
  $.noConflict();
  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });
  // Code that uses other library's $ can follow here.
</script>
like image 150
Raptor Avatar answered Oct 15 '22 13:10

Raptor


$ is just a variable that is used to alias jQuery and it is a varible so anything could be assigned to it.

You can get detailed information related to it from its Documentation

like image 45
Sachin Avatar answered Oct 15 '22 14:10

Sachin