How does jQuery achieve making $ an alias for the jQuery function?

后端 未结 4 2161
一生所求
一生所求 2020-12-14 09:00

I’m having a little trouble wrapping my head around the $ sign being an alias for the jQuery function, particularly in a plugin. Can you explain how jQuery achieves this ali

4条回答
  •  抹茶落季
    2020-12-14 09:17

    Exact code (from jquery-1.4.1-vsdoc.js):

    // Expose jQuery to the global object
    window.jQuery = window.$ = jQuery;
    

提交回复
热议问题