My gut tells me that if I am on a messy server and the user fires two events quickly enough, and the success function c will be the value of the most recent event that calls func1 to use the wrong value. & lt --- --- This is an assumption, I have not proved it. His feeling.
How can I provide the correct value when calling func1? I prefer not to send c to the server, and I don't know how and how to serialize the data and deserialize it. How to make this code safe?
$('.blah').click(function (event) { var c = $(this).closest('.comment'); ... $.ajax({ url: "/u", type: "POST", dataType: "json", data: { ... }, success: function (data) { func1(c. data.blah);
user34537
source share