TypeError: $(…).on is not a function

前端 未结 6 2279
一整个雨季
一整个雨季 2020-12-09 14:49

I am using jQuery litebox. After adding JS and CSS files I got this error TypeError:

$(...).on is not a function at this line in js file                             


        
6条回答
  •  自闭症患者
    2020-12-09 15:40

    In my case this code solved my error :

    (function (window, document, $) {
                'use strict';
                 var $html = $('html');
                 $('input[name="myiCheck"]').on('ifClicked', function (event) {
                 alert("You clicked " + this.value);
                 });
    })(window, document, jQuery);
    

    You don't should put your function inside $(document).ready

提交回复
热议问题