javascript - How the symbol $ in jquery works? -
this question has answer here:
how can jquery run function when ever sees $ in script file? $ not javascript key character how come when ever $ appear, jquery run function? need read script file in way eval it? possible remake symbol?
the jquery javascript file has following line in it:
window.jquery = window.$ = jquery;
meaning window-scoped $
variable assigned jquery namespace, in jquery functions placed under. why can use jquery
in code $
.
you same method , character symbol, even:
window.$$ = jquery;
would mean jquery assigned $$
, etc.
Comments
Post a Comment