Posted in jquery
9
12:20 am, August 3, 2020

fix for Uncaught TypeError: e.indexOf is not a function

fix for depreciated window load Uncaught TypeError: e.indexOf is not a function at S.fn.init.S.fn.load (jquery-3.5.1.min.js:2) at default.aspx:993 I found this error when upgrading from an older version of jquery to the latest version, you need to replace $(window).load(function() {} with $(window).on('load', function () {}

Javascript

// broken version -- this version needs to be replaced with the $(window).on('load', function () {
// $(window).load(function() {}

// fixed version
 $(window).on('load', function () {
      alert("Window Loaded");
 });

View Statistics
This Week
40
This Month
223
This Year
0

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

Join me on Substack if you want me to send you a collection of the things i have done or found or read for the week. Or follow me on twitter if you prefer, i dont post much but i probably should!

❤👩‍💻🕹

Random Quote
The problem with hoarding is you end up living off your reserves. Eventually, you’ll become stale. If you give away everything you have, you are left with nothing. This forces you to look, to be aware, to replenish. . . . Somehow the more you give away, the more comes back to you.
Paul Arden