2
此代码似乎真的很长 - 但我不完全理解阿贾克斯功能是把这段代码转换jQuery的 - 我的主要问题是我不知道如何实现这个responseText位如何将此javascript ajax代码转换为查询ajax?
任何帮助是非常赞赏:
function getCategory(category){
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("products").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","productlist.php?q="+category,true);
xmlhttp.send();
}
哇这个很简单..谢谢! –