Jump to content

Archived

This topic is now archived and is closed to further replies.

Goose

stop javascript execution

Recommended Posts

First off, I think part of my problem here is that I am not sure which terms to use in order to search for this subject.

My problem:
I have a control panel on one of my websites that is all AJAX driven. When a user changes a setting the JavaScript fires on the "onchange" event. The JavaScript makes my http_request object, calls my server code, gets the result back, passes the result to another JavaScript function which takes care of the visual updates of what is happening with the AJAX call. If the AJAX call is successful this method displays an image with a check mark next to the form field. After 10 seconds I have that check mark fade away. This all works great.

However, if I successfully change a setting and then 5 seconds later I decide to change it again and that change is made successfully, the check mark displays, but then fades out early because of the first successful AJAX call.

Is there a way to when I get a successful AJAX call back to make sure that the function x isn't running for the setting that I just changed?

Share this post


Link to post
Share on other sites
I have no about about AJAX per se, but you can always use timeouts and cancel them.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.