Do I need to include jQuery core alongside jQuery mobile?

后端 未结 2 1141
野的像风
野的像风 2021-01-17 07:42

Is it necessary to include the core of jQuery, or is the mobile framework sufficient alone? From what I`ve tried, I concluded that both files are necessary, but I would like

2条回答
  •  無奈伤痛
    2021-01-17 07:54

    http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.js

    Based on the code, it doesn't redefine jQuery but extends it so yes, you need the core.

    (function( jQuery, window, undefined ) {
    
    })( jQuery, this );
    

    It passes the jQuery object when defining jQuery.mobile. See the demo which includes core before mobile.

提交回复
热议问题