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
$.ajax({
url: "some.php",
async: true
})
XMLHTTPRequestに基づく単純なコード
var url="url to call";
var request= new XMLHttpRequest();
request.open("GET",url,true);