我有一个 Ajax 代码,我想通过它通过 http POST 安全地将私有 access_token 发送到 url,如何使用下面给定的代码来实现这一点?
function getstatus(url, placeid, access_token)
{
if(window.XMLHttpRequest)
{
xmlRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
try
{
xmlRequest = new ActiveXObject("Msxm12.xMLHTTP");
}
catch(e)
{
try
{
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
xmlRequest = false;
}
}
}
xmlRequest.open("GET",url,true);
xmlRequest.onreadystatechange = function()
{
if(xmlRequest.readyState==4)
{
if(placeid == "adminstatus")
adminstatus.innerHTML=xmlRequest.responseText;
if(placeid == "dbview")
{
dbview.innerHTML=xmlRequest.responseText;
}
}
}
xmlRequest.send();
}
考虑函数getstatus中的参数“access_token”是http POST-ed!