0
我可以訪問url「http://localhost:8080/test.php?dbname=zhenhuang」,但下面的代碼不起作用。我想知道如何在javascript中調用php文件。如何遠程調用php文件?
var http=new XMLHttpRequest();
http.onreadystatechange=function(){
console.log(http.readyState);enter code here
if(http.readyState === 4){
/*code*/
}
};
http.open("GET","http://localhost:8080/test.php?dbname=zhenhuang",true);
http.send(null);
<pre>