All pastes #811311 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-10 20:03 UTC
rendered paste body
<html>
<body>

<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
	try
  {
  	// Firefox, Opera 8.0+, Safari
  	xmlHttp=new XMLHttpRequest();
  }
	catch (e)
  {
  // Internet Explorer
  	try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
	  catch (e)
    {
  	  try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    	catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }

	if (!xmlHttp)
	{
    xmlHttp.onreadystatechange=function()
	  {
	    if(xmlHttp.readyState==4)
	    {
	      document.myForm.time.value=xmlHttp.responseText + "x";
	    }
	  }
	  xmlHttp.open("GET","time.php",true);
	  xmlHttp.send(null);
	}
}
</script>

<form name="myForm">
Name: <input type="text"
onkeyup="ajaxFunction();" name="username" />
Time: <input type="text" name="time" />
</form>

</body>
</html>


------------------------------------------------------------
<?php
echo date("H:i:s")."-x";
?>