I am attempting to make a dead simple webpage that does things when I click a button.
I am trying to use Javascript so I don't have to reload the main page or anything.
So I want a button that says "Shutdown", and I simply want to run shutDown.php that will shut down the server when I click on this.
I've been searching for an hour now and can't find a simple example. Could someone please post a very simple, example, or a link to one?
Many thanks :)
EDIT: Okay so here's my pitiful attempt.. it doesn't work.. any tips?
<html>
<head>
<title>Control Page</title>
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript">
/*************************************
JQUERY EXAMPLE
*************************************/
$('#mysubmit').click(){
var jqueryXHR = $.ajax({
'type': 'POST',
'url': 'http://localhost/killIE.php',
'dataType': 'json'
});
}
}
</script>
<input type="submit" name="mysubmit" value="Click!" />
</body>
</html>