Home > Article > Web Front-end > Solution to the problem of repeated triggering of JS events caused by Ajax partial update
If the page contains an ajax updated list, then you need to be careful about event handling in the non-dynamic update part.
Take the list interface with a public toolbar as an example:
$.ajax( .... data: { ... }, success: function(data) { $('Menu1').click( function(){ //do something } ); } )
Since the Menu1 interface part is public, It will not be reloaded as the list data is updated, so the above code will generate repeated click event triggers (after updating the list multiple times).
So we have to note that the reinitialization of toolbar event listening cannot be included in the result processing of ajax list update.
Summary: The above is the entire content of this article, I hope it will be helpful to everyone’s study. For more related tutorials, please visit JavaScript Video Tutorial, AJAX Video Tutorial!