-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemojson.html
More file actions
42 lines (38 loc) · 1.2 KB
/
demojson.html
File metadata and controls
42 lines (38 loc) · 1.2 KB
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
<html>
<head>
<script src="jquery-3.1.1.js"></script>
<script>
$(document).ready(function(){
$.getJSON('https://ulhas1991.github.io/demogit/data2.json', function (json) {
alert(json.result);
$.each(json.list, function (i, fb) {
alert(fb.result);
});
});
$.ajax({
type: "GET",
url: "http://localhost:8080/JerseyUlhas/webapi/message",
dataType: "xml",
success: function(xml) {
$(xml).find('messages').each(function(){
var id_text = $(this).attr('id');
alert($(this).find('name').text());
alert('Address is ' +$(this).find('address').text());
}); //close each(
}
});
/*var jsontext = '{"name":"x","age":"11"}';
var getContact = JSON.parse(jsontext);
alert(getContact.name + ", " + getContact.age);*/
});
</script>
</head>
<body>
<h1 align="center">Welcome to Coffee Shop</h1>
<div id="displayDaya"></div>
Enter Your Number: <input type="text" /><br>
Enter Your Name: <input type="text"/><br>
Enter your Coffee: <input type="text"/><br>
<input type="button" value="Submit">
</body>
</html>