All pastes #727958 Raw Edit

javascript error

public text v1 · immutable
·published 2007-10-06 15:46 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;        }      }    }  }}
		xmlHttp.onreadystatechange=function()
  {
  if(xmlHttp.readyState==4)
    {
    document.myForm.time.value=xmlHttp.responseText;
    }
  } 
xmlHttp.open("GET","serverTime.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>