Bhushan Lodha
Bhushan Lodha

Reputation: 6862

How to check if bootstrap's jquery-plugin is working properly?

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

Upvotes: 3

Views: 8482

Answers (4)

joseph
joseph

Reputation: 29

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

Upvotes: 0

devinbost
devinbost

Reputation: 5074

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.

Upvotes: 1

ytjohn
ytjohn

Reputation: 197

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>

Upvotes: 0

user818991
user818991

Reputation:

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!");

}

Upvotes: 2

Related Questions