Forum Moderators: open

Message Too Old, No Replies

Nivo Slider Not Working With jQuery Update

         

Jennnnn

7:00 pm on May 9, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



I'm using a purchased template. I want to update a jQuery version my site references because Google's Lighthouse says the old version is vulnerable. I had this on my pages:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

I updated it to:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


Now my nivo slider doesn't work with the updated jQuery.

I received this browser error message in Google's Lighthouse:

TypeError: e.indexOf is not a function at w.fn.init.w.fn.load (https:////ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js. at
https://www.example.com/javascripts/slidesh js : 1:11

What does that error message mean? Is this something that can be easily fixed? Its difficult partly because the error message is cut off.

There is also a jquery.nivo.slider.js file on my site. Does this need to be updated to work with the new jQuery version?

Thanks for you help!

not2easy

8:08 pm on May 9, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It appears that the error message says something like, "the javascripts/slidesh... script wants the old jquery/1.11(.3/) and can't use jquery/3.3.1" so I would contact the supplier of the slideshow script and request an updated version.

If the folks you paid for the template included that script, they should be able to provide the update. If you added the script on your own, I'd try to find the newer version of that script.

Jennnnn

10:43 pm on May 9, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



I googled the error, e.indexOf, and it looks like the script uses some jquery event aliases like .load, .unload or .error that were deprecated since 1.8. The fix is to replace those aliases with .on()

The example given is:

$(window).load(function(){...});

becomes:

$(window).on('load', function(){ ...});

I'll try that and see if that works.