I’m using eval() in javascript to evaluate a significant amount of js code (not just json, but function calls too). The browser freezes during the call, i.e. the user cannot scroll the browser or click anything. Is there any way around this freezing problem?
Share
In most browsers, JavaScript runs on the UI thread, so it blocks the UI as you describe. The best way to un-block the UI is to break up the JS into smaller parts, and string them together with setTimeout (which gives control of the thread back to the browser for UI rendering)