是一个JavaScript类库,封装了大量的JavaScript底层代码。
JQuery的Ajax操作
对JavaScript底层Ajax操作进行了封装,提供了两种方法进行操作
底层的$.ajax()操作
快捷操作$.get()..$.post()...
写法:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
$.ajax({
url:"url",
type:"get",
dataType:"json",
data:{
userID:"1"
},
success:function(response){
},
error:function() {
}
});
$.get(
"url",
{userID:"123"},
function(response) {
}
)
$.post(
"url",
{userID:"123"},
function(response) {
}
)
</script>
</head>
<body>
</body>
</html>