<%@ Page Language= "C# " AutoEventWireup= "true " CodeBehind= "Default.aspx.cs " Inherits= "AJAXPrj._Default " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> Untitled Page </title>
</head>
<script type= "text/javascript ">
//function GetHello()
//{
// WebSvc.Service1.Hello(OnRequestComplete);
//}
//function OnRequestComplete(result)
//{
// alert(result);
//}
function createXMLHTTPRequest()
{
if (window.XMLHttpRequest)
{ //for mozilla and netscape version
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{ //for IE version
return new ActiveXObject( "Microsoft.XMLHTTP ");
}
}
var oHttpReq=null;
function GetGuid()
{
oHttpReq = new createXMLHTTPRequest();
// var strUrl = "guid.aspx ";
var strUrl = "http://www.google.com ";
oHttpReq.open( "GET ",strUrl,true);
oHttpReq.send();
oHttpReq.onreadystatechange=OnResultReturn;
}
function OnResultReturn()
{
document.all[ "spResult "].style.border= "1px solid #363636 ";
//alert(oHttpReq.readyState);
if (oHttpReq.readyState==4)
{
// document.all[ "spResult "].innerText=oHttpReq.responseText;
document.all[ "spResult "].innerHTML=oHttpReq.responseText;
}