Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>NOTE: this will trigger your shutDown.php PHP script on the server without reloading the page. But - you won't be able to parse web requests obviously after you shutdown your server :)...</p> <pre><code>/************************************* JQUERY EXAMPLE *************************************/ $('#myShutdownButton').click(){ var jqueryXHR = $.ajax({ 'type': 'GET', 'url': 'http://someServer.com/shutDown.php', 'data': {'shutdownServer': 'yes'},//optional 'dataType': 'json' }); } } </code></pre> <p>P.S. I assume that you know that you have to load jQuery library first in your html file header, something like this:</p> <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>And then put that jquery code inside of script tags:</p> <pre><code>&lt;script&gt; ...that jQuery code... &lt;/script&gt; </code></pre> <p><strong>UPDATED BY REQUEST - complete script version</strong></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Control Page&lt;/title&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; //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.') }); }) }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="submit" id="mysubmit" value="Kill da server!" style = "margin-left:100px; margin-top:100px;" /&gt; &lt;br/&gt; &lt;br/&gt; &lt;br/&gt; &lt;span id = "result"&gt;Not clicked yet - good!&lt;/span&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload