Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does one abort the previous request unless a queue is being kept track of? Also, there could have been a few other requests made between the first save and the second save. Its definitely possible I'm just not understanding how XMLHTTPRequest objects work - please do explain if you think that is the case.

Also - I'm not necessarily using XMLHTTPRequest, I'm leaning towards dynamic scripting as my site will need this widget to run across several different subdomains - dynamic scripting doesn't have a lot of the nice status functionality that XMLHTTPRequest does...




Okay, here's an alternate method.

 When a user needs to save their note
  If the note is already saving
   Set note.saveAgain = true
  else
   Start the process of saving the note
 
 When the note has saved
  If note.saveAgain == true
   Set note.saveAgain = false
   Start the process of saving the note again
That doesn't require a queue. It also only saves the most up to date version.


Cool.

Thanks again.


I can has karma now?

Edit: How dare I ask to be compensated for my time. I should be ashamed of myself.


Thanks!

If you have any more questions, feel free to ask.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: