Testing if jQueryUI has loaded

前端 未结 5 1336
误落风尘
误落风尘 2020-11-29 23:22

I\'m trying to debug a website, and I think that jQueryUI may not have loaded properly. How can I test if jQueryUI has loaded?

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 00:08

    if (jQuery.ui) {
      // UI loaded
    }
    

    OR

    if (typeof jQuery.ui != 'undefined') {
      // UI loaded
    }
    

    Should do the trick

提交回复
热议问题