-
Notifications
You must be signed in to change notification settings - Fork 0
/
untitled.html
68 lines (54 loc) · 1.71 KB
/
untitled.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html>
<head>
<title>Lesson 21: Easy AJAX Calls with jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
</head>
<body>
<h1>Lesson 21: Easy AJAX Calls with jQuery load()</h1>
<p><a href="#">Click here to fetch HTML content</a></p>
<div id="result">
</div>
<script type="text/javascript">
//JavaScript AJAX code here
// alert("check jquery")
$(document).ready(function(){
$.ajax({url: "http://localhost:8080/lob/getAllTransanctions", success: function(response){
$("#result").append("<h1>" +response[0].firstName+"</li>")
}});
var data = JSON.stringify({
"firstName": "test1234",
"lastName": "Rana",
"userName": "arana",
"password":"soomePWD"
});
console.log("call post call")
$.ajax({ type: "POST",
url: "http://localhost:8080/add/user",
contentType: "application/json; charset=utf-8",
data: data,
success: function(data, textStatus, jqXHR){
console.log("sonme ==")
console.log("sonme =="+JSON.stringify(data));
},
error: function(error){
console.log("error " + error)
}
});
$.ajax({ type: "DELETE",
url: "http://localhost:8080/delete/transaction/123",
contentType: "application/json; charset=utf-8",
data: data,
success: function(data, textStatus, jqXHR){
console.log("sonme ==")
console.log("sonme =="+JSON.stringify(data));
},
error: function(error){
console.log("error " + error)
}
});
$
});
</script>
</body>
</html>