Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMHLHttp Request Problems 1

Status
Not open for further replies.

battleangela

Technical User
May 25, 2007
11
US
Hi

I have been trying to verify and see if I can get the XMLHttprequest for certain browsers and starting of ajax. I know their is a problem but can not locate it. Can someone please review my code ?

<html>
<head>
<title>Ajax at work</title>
<script language= "javascript">
varXMLHttpRequestObject=false;

if(windowXMLHttpRequest){
XMLHttpRequest = new XMLHttpRequest();
}else if (window ActiveXObject){
XMLHttpRequest = new ActiveXObject("MicrosoftXMLHttpRequest");
}

if(XMLHttpRequestObject){
document.write("<h1>Object created</h1>");
}
else{
document.write("<h1>Your Browser does not support Ajax.</h1>);
}


</script>
</head>
<body>
</body>
</html>
 
Hi

Code:
<html>
 <head>
  <title>Ajax at work</title>
  <script language= "javascript">
   var[highlight red] [/highlight]XMLHttpRequestObject=false;

   if(window[red].[/red]XMLHttpRequest){
    XMLHttpRequest[red]Object[/red] = new XMLHttpRequest();
   }else if (window.ActiveXObject){
    XMLHttpRequest[red]Object[/red] = new ActiveXObject("[red]Microsoft.XMLHTTP[/red]");
   }

   if(XMLHttpRequestObject){
    document.write("<h1>Object created</h1>");
   }
   else{
    document.write("<h1>Your Browser does not support Ajax.</h1>[red]"[/red]);
   }
   

  </script>
 </head>
<body>
</body>
</html>

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top