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,731
  • 2
  • 29
  • 32
Vnuuk
  • 5,825
  • 11
  • 34
  • 50

1 Answers1

4

Like this:

if(window.jQuery)
{
    //jquery found 
}
Milind Anantwar
  • 79,642
  • 23
  • 92
  • 120