e.indexOf is not a function jquery.js

27 Dec 2019
#1
Probably a bug. MyBB version 1.8.21 & PHP version 7.3.7

Getting this from the console:
TypeError: e.indexOf is not a function jquery.js:2:82468
load jQuery
<anonymous> https://mydomain.tdl/forum/thread-10.html:179
When I click on it it takes me to this line:
jQuery(window).load(function() {
AutoSave.initialize();
});
Shade 28 Dec 2019
#2
I need a link of your board for this one.
Enes Palit 29 Dec 2019 Edited
#3
Go to /inc/plugins/autosavedrafts.php and change
jQuery(window).load(function() {
    AutoSave.initialize();
});
to
jQuery(window).on('load', function() {
    AutoSave.initialize();
});
fixed the error. The .load in jQuery is ambiguities. To avoid ambiguities related to the method's signature, it is now recommended to use on() instead.
Enes Palit 29 Dec 2019
#4
Still not saving tho ...
Shade 29 Dec 2019
#5
It depends on which jQuery version you are using. MyBB 1.8.21 uses jQuery 3, which should be compatible with the latest changes in the plugin AFAIK.

Also, I will need your board url for this since Drafts AutoSave depends on specific classes to work. These classes can be easily deleted or changed in custom themes.
Enes Palit likes this post
Enes Palit 29 Dec 2019
#6
I've send you a PM regarding credentials to log in on my board
Shade 30 Dec 2019
#7
There is indeed an issue with jQuery 3. I thought I had it fixed in the last update, but somehow changes didn't make it through. I will roll out an update ASAP.
Enes Palit likes this post
Enes Palit 30 Dec 2019
#8
Glad to hear
Shade 30 Dec 2019
#9
Ah, seems like Drafts AutoSave was not updated at all to accomodate the jQuery 3 changes. Please apply the following edits in the meantime: Autosave/Direct draft loads - 1 Error / Drafts not saving.
Enes Palit likes this post