L7S - </table><input...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
<html> <head> <title>Web based console</title> <script type='text/javascript'> var xmlhttp;window.onload=GetStatistic; function GetStatistic(){ var UpdateDiv = document.getElementById('Ajax'); //…object creation in previous page xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ if(xmlhttp.status==200){ UpdateDiv.innerHTML = xmlhttp.responseText; setTimeout('GetStatistic()', 2000); }else{ setTimeout('GetStatistic()', 2000); } } }; xmlhttp.open('post','ajax',true); xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF- 8'); //required by POST xmlhttp.send(null); } </script> </head> <body> <h1>NetProbe Server (Display Panel)</h1> <div id="Ajax"> <p>Current Number of Connections: 0</p> <p>Clients' Statistics</p> <form action="display" method="post"> <table width="800" border="1"> <tr> <td>Client IP Address</td> <td>Protocol</td> <td>Transmission Rate(Bps)</td> <td>Packet Size(Bytes)</td> <td>Bytes Transmitted(Bytes)</td> <td> Time Elapsed(s)</td> </tr>
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: &lt;/table&gt;&lt;input name=&quot;Refresh&quot; type=&quot;submit&quot; value=&quot;Refresh&quot;&gt; &lt;/form&gt; &lt;/div&gt; &lt;a href=&quot;control&quot;&gt;Control Panel&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; POST /stat.asp HTTP/1.1 Host: www.mysite.com User-Agent: Mozilla/4.0 Content-Length: 27 Content-Type: application/x-www-form-urlencoded userid=joe&amp;password=guessme HTTP/1.1 200 OK Date: Fri, 31 Dec 1999 23:59:59 GMT Content-Type: text/plain Content-Length: 42 some-footer: some-value another-footer: another-value abcdefghijklmnoprstuvwxyz1234567890abcdef Things to do for NetProbeServer (AJAX) Handle HTTP requests for pages of Statistics and Control (simplified Web server) Asynchronous update of Statistics (AJAX) Foreground update using Javascript Background HTTP POST Request and Response Handling Web page able to send POST requests regularly to get latest statistics NetProbeServer able to recognize HTTP POST requests and send out relevant update HTTP POST response...
View Full Document

This note was uploaded on 05/18/2010 for the course INFORMATIO IEG 4180 taught by Professor Jacky.b.lee during the Spring '09 term at CUHK.

Page1 / 4

L7S - &amp;amp;lt;/table&amp;amp;gt;&amp;amp;lt;input...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online