jquery 3.0 url.indexOf error

后端 未结 5 811
臣服心动
臣服心动 2020-11-27 10:24

I am getting following error from jQuery once it has been updated to v3.0.0.

jquery.js:9612 Uncaught TypeError: url.indexOf is not a function

5条回答
  •  盖世英雄少女心
    2020-11-27 11:08

    Better approach may be a polyfill like this

    jQuery.fn.load = function(callback){ $(window).on("load", callback) };
    

    With this you can leave the legacy code untouched. If you use webpack be sure to use script-loader.

提交回复
热议问题