var xmlHttp;
function RefreshORP(eventTarget, eventArgument)
{
xmlHttp = GetXmlHttpObject();
if(xmlHttp == null)
{
return true;
}
xmlHttp.onreadystatechange = StateChanged;
var params = GetFormParam(eventTarget,eventArgument);
xmlHttp.open("POST","/contact.jsp",true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("ajaxcall", "true");
xmlHttp.send(params);
}
最佳答案
在 jQuery 中你已经完成了这一切......
$.post("/contact.jsp", $("formID").serialize(), function(data){
// process callback
});
jQuery 还将设置所有适当的(并且以某种方式标准化的)请求 header 。
关于javascript - 如何将此工作 JS 代码转换为 JQUERY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1439005/