jquery之利用ajax与服务器交谈(加载内容到元素上之不依赖jquery,而利用原生API) ---------- 实例: var xhr; if(window.XMLHttpRequest){ xhr = new XMLHttpRequest(); }else if(window.ActiveXObject){ xhr = new ActiveXObject("Msxml2.XMLHTTP"); }else{ throw new Error("Ajax is not supported by this browser"); } xhr.onreadystatechange = function(){ if(xhr.readyState == 4){ if(xhr.status >= 200 && xhr.status <300){ document.getElementById('someContainer').innerHTML = xhr.responseText; } } } xhr.open('GET','/serverResource'); xhr.send();