Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: HTML  |  size: 1.16 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6.         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="application/javascript"></script>
  7.         <script type="text/javascript">
  8.                 $(document).ready(function() {
  9.                         $("a").click(function() {
  10.                                 var check =  $(this).attr("id");
  11.                                 send(check);           
  12.                         });
  13.                 });
  14.                
  15.                 function check(value) {
  16.                         if (value == start) {
  17.                                 setInterval(send(), 2000);
  18.                         } else {
  19.                                 alert ("Process is stopped or is already stopped");    
  20.                         }
  21.                 };
  22.                
  23.                 function send() {
  24.                         var sitetocheck = $("#site").val();
  25.                         $.ajax({
  26.                                 type: "POST",
  27.                                 url: "/js/domain_post.php",
  28.                                 data: { site: sitetocheck  }
  29.                         }).done(function( msg ) {
  30.                          $("#wrapper").append("Send data to server");
  31.                         });
  32.                 };                             
  33.         </script>
  34. </head>
  35. <body>
  36.         <div id="wrapper">
  37.                 <input id="site" type="text" /><br />
  38.                 <a id="start">START</a><br />
  39.                 <a id="stop">STOP</a>
  40.         </div>
  41. </body>
  42. </html>