Asynchronous data fetch from server is mainly reliable in my project which currently uses a "localhost" server. At times though the XMLHttpRequest onreadystate event does not fire and I am suspecting this is due to javascript code still executing when the fetched data becomes available.
Summary of process:
user click onclick code starts XMLHttpRequest object initialised for asynchronous fetch. onclick clean-up code continues onclick code ends

I am suspecting that when the amount of "onclick clean-up code" is larger (eg a report being output), then the XMLHttpRequest onreadystate event is somehow inhibited.

Thank you for any comments.

I am vaguely aware that "yield" has become part of later javascript specifications. Would this help.

Might want to actually show your code, explaining it helps but seeing your code is much more helpful. And the yield operator is used for generator-iterators not AJAX.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.