Demo code taken from the post “Separating the Javascript UI Thread to create more responsive web apps

This interface will not be blocked while factorial is being calculated

HTML Source

factorial.js