load() method deprecated?

See bug #11733, which documents this deprecation:

The .load() method is an ambiguous signature, it can either be an ajax
load or attach/fire a “load” event. CCAO cannot tell them apart since
it’s a dynamic decision based on arguments.

To avoid ambiguities related to the method’s signature, it is now recommended to use on() instead. For instance:

$("selector").load(function() {
    // ...
});

Should become:

$("selector").on("load", function() {
    // ...
});

Leave a Comment