jQuery and other libraries, and the usage of '$'

前端 未结 6 731
孤独总比滥情好
孤独总比滥情好 2021-01-07 03:37

I have a quick, beginners-type-question. If I were to use jQuery and some other framework, would the following statement be problematic:

jQuery(document).rea         


        
6条回答
  •  广开言路
    2021-01-07 03:42

    jQuery(document).ready(function ($) {
        $("input[name='password']").focus(function () {
            $("input[value='login']").attr("checked", "checked");
        });
    });
    

    Callback for ready() receives jQuery as an argument: you can call this argument $. This will override other $ definition in the scope of the callback.

提交回复
热议问题