• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Any AJAX/javascript developers? Got a question for you

Argo

Lifer
Here's the situation:

I have multiple 'onchange' handlers setup that all update a common variable (build a url string with parameters that changed)

I also have a timer function that wakes up every X minutes and uses the url built by onchange handlers to send an update request to the server, after which it empties out the url variable.

So obviously there are some concurrency issues here - what if two onchange handlers fire at the same time, or the timer function fires as the onchange handler is executing.

What is the best way to deal with that?
 
JavaScript uses run-to-completion semantics - you're not going to see real concurrency. As far as your code will be able to tell, only one function will be running at any given time.
 
Back
Top