首页 > 代码库 > ajax用法

ajax用法

1.将其他页面加载进来

<head>
<script type="text/javascript" src="http://www.mamicode.com/~/Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#b01").click(function(){
htmlobj=$.ajax({url:"Register",async:false});
$("#myDiv").html(htmlobj.responseText);
});
});
</script>
</head>
<body>

<div id="myDiv"><h2>通过 AJAX</h2></div>
<button id="b01" type="button">改变内容</button>

</body>

2.点赞

http://blog.csdn.net/chinacsharper/article/details/9748639

ajax用法