Jump to content

Possible to cancel AJAX request on function?


astralaaron

Recommended Posts

I have some intervals set on my page making AJAX calls every few seconds to update some live info. there is a textarea on this page, when keyCode 13 is pressed (enter) the value of the textareais sent through an AJAX call to the database - it all works besides it seems like if you press enter during one of the intervalAJAX calls instead of sending the data from the textarea it returns a new line. I am stuck..maybe thinking that it is possible to abort the other AJAX calls if enter is pressed to gaurantee that the call is made??[edit] - I am thinking maybe something like using Shift+Enter to make the AJAX call, and when shift is pushed down the intervals are cleared.then when shift is released to start the intervals again. --any thoughts?

Link to comment
Share on other sites

Umm.. have you tried using two different XMLHttpRequest objects, one to GET and one to POST?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...