Advertisement
Guest User

Untitled

a guest
Feb 27th, 2012
2,651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <script type="text/javascript">
  2. document.write('<div id="loading"><br><center>Testing VPN Connections...<img src="./images/progress_bar.gif"/><center></div>');
  3. //Ajax Function
  4. function getHTTPObject()
  5. {
  6. var xmlhttp;
  7. if (window.ActiveXObject)
  8. {
  9. try
  10. {
  11. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  12. }
  13. catch (e)
  14. {
  15. try
  16. {
  17. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  18. }
  19. catch (E)
  20. {
  21. xmlhttp = false;
  22. }
  23. }
  24. }
  25. else
  26. {
  27. xmlhttp = false;
  28. }
  29. if (window.XMLHttpRequest)
  30. {
  31. try
  32. {
  33. xmlhttp = new XMLHttpRequest();
  34. }
  35. catch (e)
  36. {
  37. xmlhttp = false;
  38. }
  39. }
  40. return xmlhttp;
  41. }
  42. //HTTP Objects..
  43. var http = getHTTPObject();
  44.  
  45. //Function which we are calling...
  46. function AjaxFunction()
  47. {
  48. url='status2.php';
  49. http.open("GET",url, true);
  50. http.onreadystatechange = function()
  51. {
  52. if (http.readyState == 4)
  53. {
  54. //Change the text when result comes.....
  55. document.getElementById("loading").innerHTML=http. responseText;
  56. }
  57. }
  58. http.send(null);
  59. }
  60. </script>
  61. </head>
  62. <body onload="AjaxFunction()">
  63. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement