سلام به اساتید. من یه سایت طراحی کردم. تو localhost هیچ مشکلی نداره ولی وقتی رو هاست گزاشتم کد درخواست مدل کار نمیکنه.
پیغام XMLHttp not found میده.
function getXMLHTTP()
{
var x = false;
try
{
x = new XMLHttpRequest();
}
catch(e)
{
try
{
x = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ex)
{
try
{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1)
{
x = false;
}
}
}
retu x;
}
function getModel(Brand_Id)
{
var strURL="findModelsearch?Brand="+Brand_Id;
var req = new XMLHttpRequest();
if (req)
{
req.onreadystatechange = function()
{
if (req.readyState == 4)
{
if (req.status == 200)
{
document.getElementById('Modeldiv').ierHTML=req. responseText;
}
else
{
alert("Problem while using XMLHTTP:n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
برچسب:
نویسنده: محمد رضا جوادیان