作者:
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>