Copy codeThe Code is as follows:
// Synchronous Transmission Mode
Function RequestByGet (nProducttemp, nCountrytemp)
{
Var xmlhttp
If (window. XMLHttpRequest)
{
// IsIE = false;
Xmlhttp = new XMLHttpRequest ();
}
Else if (window. ActiveXObject)
{
// IsIE = true;
Xmlhttp = new ActiveXObject ("Microsoft. XMLHTTP ");
}
// Web page location.
Var URL = "http://www.jb51.net /;
Xmlhttp. open ("GET", URL, false );
// Xmlhttp. SetRequestHeader ("Content-Type", "text/html; charset = Shift_JIS ")
Xmlhttp. send (null );
Var result = xmlhttp. status;
// OK
If (result = 200)
{
Document. getElementById ("div_RightBarBody"). innerHTML = xmlhttp. responseText;
}
Xmlhttp = null;
}
// Asynchronous transmission mode
Var xmlhttp
Function RequestByGet (nProducttemp, nCountrytemp)
{
If (window. XMLHttpRequest)
{
// IsIE = false;
Xmlhttp = new XMLHttpRequest ();
}
Else if (window. ActiveXObject)
{
// IsIE = true;
Xmlhttp = new ActiveXObject ("Microsoft. XMLHTTP ");
}
// Web page location.
Var URL = "http://www.jb51.net /";
Xmlhttp. open ("GET", URL, true );
Xmlhttp. onreadystatechange = handleResponse;
// Xmlhttp. SetRequestHeader ("Content-Type", "text/html; charset = UTF-8 ")
Xmlhttp. send (null );
}
Function handleResponse ()
{
If (xmlhttp. readyState = 4 & xmlhttp. status = 200)
{
Document. getElementById ("div_RightBarBody"). innerHTML = xmlhttp. responseText;
Xmlhttp = null;
}
}