weixin_33744854 2015-09-08 13:05 采纳率: 0%
浏览 23

无法从Ajax获得响应

Can't get responce from Following ajax Script That Call Php Script that Echo Cost Of Given Item name

function ajaxfunc2(Item_name)
{
var xmlhttp;
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)
  {
     document.getElementById("cost").value=xmlhttp.responseText;
         alert(xmlhttp.responseText);
    }
    }

xmlhttp.open("GET","find.php?Item="+Item_name,true);
xmlhttp.send(null);

}

But I will Get Output from Php File

with this link

127.0.0.1:8888/Pharmaceutical Distribution System/PDS/find.php?Item=1st tshirt
  • 写回答

0条回答 默认 最新

    报告相同问题?