4 ms·
But shouldn't the page at least run in its own thread (or process)? If Javascript hangs, sure the page can hang, but the browser UI should still work and give
by AshleysBrain 15y ago
But shouldn't the page at least run in its own thread (or process)? If Javascript hangs, sure the page can hang, but the browser UI should still work and give you the opportunity to terminate or recover. According to TFA, Javascript blocks the UI thread in IE9.
Their own guidelines that they link to [1] says "Do not: call into any 'unknown' code from your UI thread". I don't see why a browser is special and can't keep to that rule - especially a modern browser like IE9.
[1] http://msdn.microsoft.com/en-us/library/dd744765(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/dd744765(v=vs.85).as...
- justsomedood 15y agoBy the UI they mean the controls inside of the page, not the browser's UI - your back, refresh and other browser controls still work. The same thing happens if you have javascript that consumes CPU and doesn't return for a long period of time. While the javascript is running controls on the page don't work such as buttons and select lists, but when the javascript finishes the UI thread regains control and responds to input again.