-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlol_call.php
32 lines (31 loc) · 1.19 KB
/
lol_call.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
<html>
<head>
<title>Control Page</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script>
//we need document.ready call to make sure that DOM loaded before we try to bind anything
$(document).ready(function() {
//Here we bind click event
$('body').bind('click', function(e){e.preventDefault();
//This is what happens on click - we send AJAX request
var jqueryXHR = $.ajax({
'type': 'POST',
'url': 'http://localhost/project/lol_func.php',
'dataType': 'json'
});
//And when AJAX requests complete(succeeded or failed) - we update text
jqueryXHR.complete(function(){
$('span#result').html('Oh no!!! the End is neearh! erver is shutting DoWn.')
});
})
});
</script>
</head>
<body>
<input type="submit" id="mysubmit" value="Kill da server!" style = "margin-left:100px; margin-top:100px;" />
<br/>
<br/>
<br/>
<span id = "result">Not clicked yet - good!</span>
</body>
</html>