浏览代码

Add "BootstrapValidator's JavaScript requires jQuery" warning

BRAHIM 11 年之前
父节点
当前提交
1bf2e3dc7d
共有 1 个文件被更改,包括 6 次插入0 次删除
  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);