is your question "how to set ajax request to asynchronous?"
(because a synch request stops other thing from working until this request completes)
answer is >>
if you using $ajax you can set asynch to false as below
var url="url to call";
var request= new XMLHttpRequest();