xmlhttp ajax 同步传输
1
function 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
function RequestByGet(nProducttemp,nCountrytemp)2
{3
var xmlhttp4

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
//OK24
if(result==200)25
{26
document.getElementById("div_RightBarBody").innerHTML=xmlhttp.responseText;27
}28
xmlhttp = null;29
}30




浙公网安备 33010602011771号