-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.php
66 lines (48 loc) · 1.13 KB
/
ajax.php
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
<html>
<head>
<title> ajax demo</title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
</head>
<body>
this is ajax demo
<input class= "form-control" type="text" name="usn">
<p id="gha"> </p>
<script >
$(document).ready(function(){
/* var gh =$.ajax({
url: "https://api.github.com/users/Ankit-Kulkarni",
statusCode: {
404: function() {
alert( "page not found" );
}
},
context: document.body
}).done(function() {
alert("hello");
$("#gha").innerHTML(gh);*/
}) ;
function add(){
$.ajax({
url: "https://api.github.com/users/Ankit-Kulkarni"
})
.done(function( text ) {
alert("hello");
$("gha").innerHTML("hii");
});
}
/* console.log(gh);*/
</script>
<button class="btn btn-primary" onclick="add()">add a field</button>
</body>
</html>
<!--
$.ajax({
url: "test.html",
cache: false
})
.done(function( html ) {
$( "#gha" ).append( html );
});
-->