Seven blog

天行健,君子以自强不息

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

xmlhttp ajax 同步传输

 1function RequestByGet(nProducttemp,nCountrytemp)
 2{
 3    var xmlhttp
 4
 5    if (window.XMLHttpRequest)  
 6    {  
 7         //isIE   =   false;  
 8         xmlhttp   =   new   XMLHttpRequest();  
 9    }
  
10    else if (window.ActiveXObject)
11    {  
12         //isIE   =   true;  
13         xmlhttp   =   new   ActiveXObject("Microsoft.XMLHTTP");  
14    }

15                 
16    //Web page location.
17    var URL="http://staging2:3002/products/rightbarincludes/rightbarajax.asp?nProduct=" + nProducttemp + "&nCountry=" + nCountrytemp;
18    xmlhttp.open("GET",URL, false);
19    //xmlhttp.SetRequestHeader("Content-Type","text/html; charset=Shift_JIS")
20    xmlhttp.send(null);
21    var result = xmlhttp.status;
22   
23    //OK
24    if(result==200)
25    {
26        document.getElementById("div_RightBarBody").innerHTML=xmlhttp.responseText;
27    }

28    xmlhttp = null;
29}

30
posted on 2007-08-30 13:56  china-seven  阅读(190)  评论(0)    收藏  举报