3

Is there a way to check if twitter-bootstrap's jquery plugins are working properly?

Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100

4 Answers4

2

Use

if (typeof jQuery != 'undefined') {

    alert("jQuery library is loaded!");

}else{

    alert("jQuery library is not found!");

}

or

if (jQuery) {  

   alert("jQuery library is loaded!");

} else {

   alert("jQuery library is not found!");

}
1

A much better answer is already here: How to check if Twitter Bootstrap is Loaded. If jQuery is also having problems, such as if the "$" character is not defined when you run the code from the link above, or if you want to check if jQuery itself is loading, try here: jQuery is not defined.

Community
  • 1
  • 1
devinbost
  • 4,658
  • 2
  • 44
  • 57
0

I ran into this same issue. Here is how I can load bootstrap from the CDN or fail to local.

    <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
    <script>if ($('body').popover) { document.write('bootstrap loaded from cdn') }
            else { document.write('cdn bootstrap failed, going local');
                   document.write('<script src="js/vendor/bootstrap.min.js"><\/script>') }
    </script>
ytjohn
  • 197
  • 1
  • 7
0

How to check in Python and Appium if bootstrap.js is properly loaded and working.

joseph
  • 9
  • 3