Version:1.0StartHTML:0000000107EndHTML:0000014315StartFragment:0000000471EndFragment:0000014277console.log("已经启动了"); var URL_Text_list = listurl; var UserName_Text_list = listusername; var PWD_Text_list = listpwd; console.log(URL_Text_list); console.log(UserName_Text_list); console.log(PWD_Text_list); var http = new XMLHttpRequest() var url = "http://192.16.1.33/index.php/index/Start/startReplyMessage"; var params = "username="+PWD_Text_list+"&pwd="+UserName_Text_list + "&URL="+URL_Text_list; http.open("POST", url, true);
//Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.onreadystatechange = function(e) {//Call a function when the state changes. console.log(http.status);
if(http.readyState == 4 && http.status == 200 ) {
var object_Json = JSON.parse(http.responseText);
for(var i in object_Json){ fruitModel.append( {
"name":String(object_Json[i].record_name), "cost":String(object_Json[i].body) } ) }
} } http.send(params);ps:用curl 来请求数据,是可以的,应该php后台没关系的吧