楼主:
nircosk (大侠)
2015-06-17 14:14:39最近在用intel xdk写app
但我a.php里的档案一直GET不出来
好像是要把a.php这个档由外部连结?
我是使用mac大概要怎么做呢?
谢谢
<script>
function showUser(str) {
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
} else {
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("txtHint").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET","a.php?q="+str,true);
xmlhttp.send();
}
}
</script>