Web サービスを使用して jquery 経由で vtiger crm にログインする際に問題があります。これは私のコードです:
function doLogin(){
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status === 200)
{
alert(xmlhttp.responseText);
}else{
}
}
xmlhttp.open("GET","http://vtiger_path/webservice.php?operation=getchallenge&username=admin",true);
xmlhttp.setRequestHeader("Content-type","json");
xmlhttp.send();
}
はxmlhttp.status
常に 0 なので、アラートは表示されません。