I learned from this article that to avoid confliction between javascript libraries, use jQuery.noConflict(); function just before jQuery(document).ready ( function () { }) and replace jQuery at all instance of $
but i have seen many jQuery plugin where $ is used with variable declaration???
here is an example on this link on below section
How to...
[edit]
...retrieve the index of the currently selected tab
var $tabs = $('#example').tabs();
var selected = $tabs.tabs('option', 'selected'); // => 0
now i m really confused how to replace $ with jQuery in var $tabs??
first of all tell me how can we use jQuery instead of $ in above example and
what is the logic behind declaring variable starting with $ in javascript?? ( although this is a PHP varaible decalarion syntax)
Thank you.
$tabsis just a variable name. That’s because javascript accepts a$as part of a variable.You can also use variables like
my$var = 10ormy$other$var$ = 20.To use
jQueryinstead of$just substitute it in your code:becomes