-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathajax.html
More file actions
29 lines (29 loc) · 691 Bytes
/
Copy pathajax.html
File metadata and controls
29 lines (29 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
<title>jQuery ajax() Example</title>
<script type="text/javascript" src="lib/jquery/jquery-3.3.1.js"></script>
<script type="text/javascript">
$.ajax({
url: 'user.php',
contentType: 'application/json',
type: 'post',
dataType: 'json',
async: true,
cache: true,
data: JSON.stringify(postData),
success: function(xhr, status) {
if (status == 'success') {
//some code
}
},
error: function(xhr, status) {
//error handling
}
});
</script>
</head>
<body>
<div id="container"></div>
</body>
</html>