I have a link on a web page opens up a modal dialog. The first time the link is clicked initialization code executes. Subsequent clicks do not need to do any processing. The problem here is when people double click the link the initializing code runs twice -even though I am setting a flag immediately to say that I am initialized, and if flagged don't run the init function. What should I do?
I use Ben Nadel's jQuery ajax wrapper. Every time you create an ajax request, you can optionally give it a name. The ajax wrapper tracks all named requests and drops any duplicates if it's still waiting on a response from a previous request with the same name.
By putting all your ajax calls through this "pipeline", you have great centralized control over handling every call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With