记录一个ajax的一个测试程序
<!DOCTYPE html>
<html>
<head>
<Meta charset="UTF-8">
<title></title>
<% #include virtual="/include/page.html"%>
</head>
<body>
<button class="btn">按钮</button>
<script> $(".btn").click(function(){ console.log("ajax func"); $.ajax({ url: 'status.asp',async:true,dataType: 'json',type: 'post',data:{"StatusType":"2"},success: function(data) { console.log(data); console.log("2"); },error: function(xhr,type,errorThrown) { console.log("加载失败2"); } }); }); </script>
</body>
</html>