{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L7S - </table><input name="Refresh"...

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 Document Right 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 Document Right 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: </table><input name="Refresh" type="submit" value="Refresh"> </form> </div> <a href="control">Control Panel</a> </body> </html> 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&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

{[ snackBarMessage ]}