JQuery.AJAX中的post方法

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jquery_Ajax_post请求</title>
<script type="text/javascript" src="js/jquery-1.2.6.js"></script>
<script type="text/javascript">
$(document).ready(
function(){
$(
"#divPost").click(function(){
$.post(
"post.ashx",{CId:$("#columnId").val()},function(data){
//[{"id":"28","Title":"一级栏目(1)"},{"id":"29","Title":"一级栏目(1)"}]
$(\'#showPost ul\').html("");
for(var i=0;i<data.length;i++)
{
var li = $("<li></li>").html(data[i].Title);
$(
"#showPost ul").append(li);
}
},
"json");
});
});
</script>
</head>
<body>
<div>栏目Id:<input id="columnId" type="text"/></div>
<div id="divPost">点击:【Jquery_Ajax_post请求】</div>
<div id="showPost"><ul></ul></div>

</body>
</html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzwzsg.html