Replace window.onload with jQuery alternative
Hi,
This is David from the WPML compatibility team. Im writing about a problem we found when using WPML with your plugin which was initially reported here:
https://wpml.org/forums/topic/wpml-doesnt-recognize-french-as-a-separate-language-in-menus/
The problem is that you are manipulating window.onload directly in ap-admin.js. This can lead to compatibility problems with other plugins. In general, its a good idea to avoid assigning functions directly to onload.
You are already using jQuery, why not use its method instead?
jQuery( window ).load(function() {
// Run code
});
Let me know if you are willing to include this fix to provide our common users with a smoother experience.
Best,
David García Watkins
WPML Compatibility Team
OnTheGoSystems
The makers of WPML, Toolset and ICanLocalize
I still see window.onload still being used here:
https://github.com/anspress/anspress/blob/4.1.0/assets/js/ap-admin.js#L23
Hello David,
I don’t see any problematic JS in ap-admin.js in our latest beta version. I remember that I deleted many old codes in beta version.
Please conform if I can assume this issue as already fixed. Here is the link to latest ap-admin.js file:
https://github.com/anspress/anspress/blob/4.1.0/assets/js/ap-admin.js
Ah, I misunderstood. Now its fixed.