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 () {}


// 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");

Page Views

This page has been viewed 269 times.

Search Code
Search Code by entering your search text above.

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.


Random Quote
For a long time it had seemed to me that life was about to begin - real life. But there was always some obstacle in the way, something to be gotten through first, some unfinished business, time still to be served, or a debt to be paid. Then life would begin. At last it dawned on me that these obstacles were my life.
Alfred D. Souza