Yep - technology called called AJAX.
You can either write it in raw javascript or use ready made libraries.
The most popular JS library nowadays (subjectively) is jQuery, I ll use it in my example.
NOTE:这将引发您的关闭。 服务器上的硬拷贝没有上载。 但是,在你关闭服务器之后,你显然能够提出网络要求:
/*************************************
JQUERY EXAMPLE
*************************************/
$( #myShutdownButton ).click(){
var jqueryXHR = $.ajax({
type : GET ,
url : http://someServer.com/shutDown.php ,
data : { shutdownServer : yes },//optional
dataType : json
});
}
}
P.S.,我假定,你知道,你必须首先在你的html档案馆上装饰图书馆,例如:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
之后,将这种分类法置于文字标签内:
<script>
...that jQuery code...
</script>
www.un.org/Depts/DGACM/index_spanish.htm 内容提要——完整的文字版
<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
$( #mysubmit ).bind( click , function(e){e.preventDefault();
//This is what happens on click - we send AJAX request
var jqueryXHR = $.ajax({
type : POST ,
url : http://localhost/killIE.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>