Is there a way to check if twitter-bootstrap
's jquery
plugins are working properly?
Asked
Active
Viewed 8,345 times
3

Bhushan Lodha
- 6,824
- 7
- 62
- 100
-
confirm if they are working correctly. – Bhushan Lodha Jul 26 '12 at 08:14
-
1By working do you mean - working on a browser X, have been downloaded by the client, have defects in the code base? – Kane Jul 26 '12 at 08:17
4 Answers
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!");
}
-
sorry but I am new to front-end stuff. exactly where shud i run this code? – Bhushan Lodha Jul 26 '12 at 08:35
-
-
2That doesn't test specifically if twitter's bootstrap has loaded. You'd have to use something like if(jQuery().Carousel) {} since bootstrap isn't namespaced as 'Bootstrap'. – bafromca Sep 18 '12 at 16:40
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.
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
-
Welcome to the community. Please try to read again the rules for posting answers and questions. – dpapadopoulos Sep 17 '20 at 20:15