@@ -10,26 +10,26 @@ Disallows global ajax events handlers: [`.ajaxComplete`](https://api.jquery.com/
1010
1111❌ Examples of ** incorrect** code:
1212``` js
13- $ ( document ).on ( ' ajaxSend' , function ( e ) { } );
14- $ ( document ).on ( ' ajaxSuccess' , function ( e ) { } );
15- $form .on ( ' ajaxError' , function ( e ) { } );
16- $form .on ( ' ajaxComplete' , function ( e ) { } );
17- $form .on ( ' ajaxStart' , function ( e ) { } );
18- $form .on ( ' ajaxStop' , function ( e ) { } );
19- $ ( document ).ajaxSend ( function ( e ) { } );
20- $ ( document ).ajaxSuccess ( function ( e ) { } );
21- $form .ajaxError ( function ( e ) { } );
22- $form .ajaxComplete ( function ( e ) { } );
23- $form .ajaxStart ( function ( e ) { } );
24- $form .ajaxStop ( function ( e ) { } );
13+ $ ( document ).on ( ' ajaxSend' , fn );
14+ $ ( document ).on ( ' ajaxSuccess' , fn );
15+ $form .on ( ' ajaxError' , fn );
16+ $form .on ( ' ajaxComplete' , fn );
17+ $form .on ( ' ajaxStart' , fn );
18+ $form .on ( ' ajaxStop' , fn );
19+ $ ( document ).ajaxSend ( fn );
20+ $ ( document ).ajaxSuccess ( fn );
21+ $form .ajaxError ( fn );
22+ $form .ajaxComplete ( fn );
23+ $form .ajaxStart ( fn );
24+ $form .ajaxStop ( fn );
2525```
2626
2727✔️ Examples of ** correct** code:
2828``` js
29- $ ( document ).on ( ' click' , function ( e ) { } );
30- $form .on ( ' submit' , function ( e ) { } );
29+ $ ( document ).on ( ' click' , fn );
30+ $form .on ( ' submit' , fn );
3131$form .on ();
32- on ( ' ajaxSuccess' , ' .js-select-menu' , function ( e ) { } );
32+ on ( ' ajaxSuccess' , ' .js-select-menu' , fn );
3333form .on ( ' ajaxSend' );
3434form .ajaxSend ();
3535$ .ajaxSend ();
0 commit comments