-------------------------- Question
Recently, developers encountered a very strange problem. Multiple requests occurred when clicking a button to submit, leading to data duplication.
After debugging, it is found that the cause of the problem is $ ("# id "). live ("click", function () {}); this live body cannot meet the requirements if bind is used, because if html rather than json is returned after an asynchronous request, when you use html to refresh the page, the bind component may become invalid.
--------------------------- Solution
Therefore, The onclick attribute can only be added to the html Tag Element.
This not only solves the problem of asynchronous html format response, but also solves the problem of page refresh (including js part) due to multiple html () refreshes) the bug that causes multiple requests to be clicked at a time due to multiple bindings.