Ajax, javascript and threads : the final truth
Written by on June 14th, 2007 in Ajax News.
Dan Simard has been writing about threading and JavaScript and came up with his Final Truth.
Dan has an example that has a long running function that fires of an XHR request at the beginning. Will that response come back when it is done, or will it wait for the method to complete.
There are many comments comparing various browsers, and how things change when you change between synchronous and asynchronous calls.
The truth seems to be:
- You can’t trust it to happen one way in all browsers / scenarios
- Please split up your functions
Source: Ajaxian
Original Article: http://ajaxian.com/archives/ajax-javascript-and-threads-the-final-truth