Timing and synchronization in JavaScript

Sun, 2009-09-27 20:47 by admin · Forum/category:

By Olav Junker Kjær · 27 Feb, 2007

Read the complete article

Timing issues are the source of some of the most devious bugs in JavaScript applications. Problems that never show up during development might surface when the application is used by an end-user on a slow computer or with low bandwidth. Such issues may also be intermittent and difficult to reproduce.

A simple example: consider a button with a click event-handler that modifies another element below it. If the user clicks the button before the element below has been parsed, the script will fail. The developer will never notice the issue, because he tests the page on a fast computer with a fast connection, where the whole page is rendered in one instant.

This article attempts to describe the various timing-related issues in JavaScript in current browsers. …

Read the complete article

Average: 4 (1 vote)