1.原生ajax
 
function loadXMLDoc()
{
  var xmlhttp;
  
  
if (window.XMLHttpRequest)
  {
    
    xmlhttp=
new XMLHttpRequest();
  }
  
else
  {
    
    xmlhttp=
new ActiveXObject(
"Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=
function()
  {
   
    if (xmlhttp.readyState==
4 && xmlhttp.status==
200)
    {
    
    document.getElementById(
"myDiv").innerHTML=xmlhttp.responseText;
    }
  }
  xmlhttp.open(
"POST",
"/try",
true);
  
  xmlhttp.setRequestHeader(
"Content-type",
"application/x-www-form-urlencoded");
  
  xmlhttp.send(
"id=1");
}
</script>
</head>
<body>
<h2>AJAX</h2>
<button type=
"button" onclick=
"loadXMLDoc()">请求数据</button>
<div id=
"myDiv"></div>
 
我只是个刚学js的菜鸟,如有问题,请指出  以上