Browse Source

Add "BootstrapValidator's JavaScript requires jQuery" warning

BRAHIM 11 years ago
parent
commit
1bf2e3dc7d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/js/bootstrapValidator.js

+ 6 - 0
src/js/bootstrapValidator.js

@@ -6,6 +6,12 @@
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT
  */
+
+// jquery warning
+if (typeof jQuery === 'undefined') {
+    throw new Error('BootstrapValidator\'s JavaScript requires jQuery')
+}
+
 (function($) {
     var BootstrapValidator = function(form, options) {
         this.$form   = $(form);