Posted in jquery
249
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 () {}

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

View Demo Full Screen View Demo New Tab

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

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

Related Tags

No Items Found.

Add Comment
Type in a Nick Name here