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?
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.
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.
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.
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>
$
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With