日期:2014-05-16 浏览次数:20689 次
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<script language="javascript" src="jquery.min.js"></script>
<script language="javascript">
$(function(){
var test = document.getElementById("test"),
testbtn = document.getElementById("testbtn");
testbtn.onclick = function(){
$.ajax({
type:"POST",
url:"test2.html",
dataType: "html",
cache: false,
async: false,
success: function(data){
test.innerHTML=data;
}
});
}
})
</script>
</head>
<body>
<input type="button" id="testbtn" value="testbtn" />
<div id="test"></div>
</body>
</html>
<p>test1</p>
<p>test2</p>
<p>test3</p>
<p>test4</p>