Is there any difference between the following: (Is there any reason to avoid example One?)
One:
$("#stuff").on("resize", function() { doThis(); });
$("#stuff").on("resize", function() { doThat(); });
Two:
$("#stuff").on("resize", function() {
doThis();
doThat();
});
Straightforwardly, there’s no real difference.
In real-world code,
Attach handlers:
Detach one handler:
The handler for
resize.Bremains attached (ie.doThis()will not be called butdoThat()will be called) .