What is the meaning of “$” sign in JavaScript

后端 未结 7 2169
无人共我
无人共我 2020-11-22 10:54

In the following JavaScript code there is a dollar ($) sign. What does it mean?

$(window).bind(\'load\', function() {
    $(\'img.protect\').pro         


        
7条回答
  •  心在旅途
    2020-11-22 11:51

    From the jQuery documentation describing the jQuery Core Object:

    Many developers prefix a $ to the name of variables that contain jQuery objects in order to help differentiate. There is nothing magic about this practice – it just helps some people keep track of what different variables contain.

提交回复
热议问题