Ajax提交实例
<html>
<head>
<title></title>
<script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/JqueryJson.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#json").click(function () {
var postdata = new Array();
postdata[1] = { id: 1, number: "yes" };
postdata[2] = { id: 2, number: "no" };
var postData = $.toJSON(postdata);
var content = $.parseJSON(postData);
$.each(content, function () {
alert(this.number);
});
$.post("json.ashx", { "array": postData }, function (data, status) {
if (status == "success") {
alert(data);
}
});
});
})
</script>
</head>
<body>
<input type="button" value="json" id="json"/>
</body>
</html>