2

What is the best way to check wether jQuery script has been included to the page? I have one, but I don't think it's elegant.

try { $("body") } catch(e) { /* doesn't exist */ }
bwegs
  • 3,769
  • 2
  • 30
  • 33
Vnuuk
  • 6,177
  • 12
  • 40
  • 53

1 Answers1

4

Like this:

if(window.jQuery)
{
    //jquery found 
}
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125