I am working on a project, in that they have used $$ to select an id/class. I am not sure about this. Can anybody tell me what does this mean. I googled it. But did not get proper answer.
$$("#" + idName + "text").setStyle('background', '#000');
I am working on a project, in that they have used $$ to select an id/class. I am not sure about this. Can anybody tell me what does this mean. I googled it. But did not get proper answer.
$$("#" + idName + "text").setStyle('background', '#000');
It's simply some library shorthand. Like jQuery assigns itself variable $
, some other library may assign $$
to itself to avoid conflicting with jQuery
In Javascript $ is a valid variable name, as is $$ and $$$. While you see it mostly used with jQuery, this is not unique to jQuery.
As another answer says, the project you're working with likely has a library which has assigned something to $$.
$ can also be used in variable names like this:
$foobar
foo$bar
Looking at $$("#" + idName + "text")
, the double $
doesn't make any sense to me but would be error in your code as jQuery shorthand alias is just a single $
and when you use $$(selector)
would make no sense.
But obviously you can assign the $$
or anything that is valid identifier to work with jQuery to make it no-conflict like below:
var $$ = jQuery.noConflict();
$$(selector); //now here $$ is jQuery alias with no problem
So, I suppose your code is using some library shorthand method jQuery alias as $$
.