Increase JavaScript Responsiveness with setTimeout

My current project requires moving an item from one list to another, and then verifying the contents of the second list against the database. In order to do this, I used the jQuery append function, and then called another function which executed a getJSON request.

Because the speed of the request was so slow, it ended up delaying the move of the item. This made the UI feel unresponsive. In order to fix this, I changed the call to the function to a setTimeout with a delay of 0. This meant that the UI could go on and do what it wanted to, while the JSON request went off and did it’s thing.

Tags: , , ,

  1. No comments yet.
(will not be published)

SetPageWidth