Jump to content


stop javascript execution

  • Please log in to reply
1 reply to this topic

#1 Goose

  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts
  • LocationOregon

Posted 17 October 2006 - 07:50 PM

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?

#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 17 October 2006 - 10:19 PM

I have no about about AJAX per se, but you can always use timeouts and cancel them.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users