看起来像 jquery ......我不能确定,因为我根本不知道 jquery,但如果是这样,你可能会得到更好的答案来标记它。我可以告诉你,javascript 有自己的同步或异步调用方法。这就是我使用的:
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
// Use the activeX object for old IE
xmlhttp.open("GET","http://some.internet.address/woot?foo=bar", false);
// The third argument in the open function determines the asynchronous nature,
//it was set to false, so the code will halt at the send() point while the request is executed.
xmlhttp.send();
// Now, if the call succeeded...
if (xmlhttp.status==200) {
response = eval('('+xmlhttp.responseText+')');
// ...save the results to an object named response...
}
else {
// ...Otherwise do some other stuff
errorFunction(xmlhttp.status);
}
这里也有很多好的信息 -
http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp