Steely Wing
Steely Wing

Reputation: 17587

How to check if jQuery UI widget is loaded?

I know I can check if jQuery UI core is loaded with jQuery.ui, but how to check if a widget (draggable) is loaded, I am using typeof($('something').draggable) == 'function', is any better way to do this?

Upvotes: 6

Views: 4329

Answers (1)

vher2
vher2

Reputation: 990

You can try like this:

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

Upvotes: 8

Related Questions