I have just installed jQuery using
npm install jquery
After merging jquery,bootstrap in a vendor file using Webpack , I am keep on getting following error
vendor.4b59d15129c2efa4408c.js:9979 Uncaught TypeError: url.indexOf is not a function
at jQuery.fn.init.jQuery.fn.load (vendor.4b59d15129c2efa4408c.js:9979)
at Object.<anonymous> (bundle.7beebbf8c43d73f31563.js:55)
at Object.<anonymous> (bundle.7beebbf8c43d73f31563.js:213)
at __webpack_require__ (vendor.4b59d15129c2efa4408c.js:55)
at Object.<anonymous> (bundle.7beebbf8c43d73f31563.js:12)
at __webpack_require__ (vendor.4b59d15129c2efa4408c.js:55)
at webpackJsonpCallback (vendor.4b59d15129c2efa4408c.js:26)
at bundle.7beebbf8c43d73f31563.js:1
What is your jQuery version? On version 3, the function $(window).load()
is deprecated. When using .load()
, .unload()
, or .error()
it will throw an error.
Replace those function with:
old
$(window).load( function () {} )
version 3 above
$(window).on('load', function () {} )
$(window).on('error', function () {} )
my own case was using SuperSimpleSlider jQuery plugins with Vue.js
. I have to replace the original file (the plugins) with correct solution.
Hope this helps!
Source: jqueryhouse.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With