PDA

View Full Version : ایراد این اسکریپ چیه؟



hatef_zt
چهارشنبه 05 فروردین 1388, 22:34 عصر
//Start Of Ajax Core
var Ajax;


//create xmlhttp object
function creatXmlHttpRequest()
{
if(window.ActiveXObject)
{
Ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
Ajax = new XMLHttpRequest();
}
}



//In Start


//////////////////////////////////////////////////////////////////////////////////////// Ajax #1
function Start_Server()
{
creatXmlHttpRequest();
var url="codeL/Connector_DataBase.php?";
Ajax.onreadystatechange = StartPage;
Ajax.open("GET",url,true);
Ajax.send(null);


}





//in Start
function StartPage()
{
document.getElementById('h1').style.backgroundColo r='#C4E1FF'
if(Ajax.readyState == 4)
{
document.getElementById('h2').style.backgroundColo r='#6699FF'
if(Ajax.status ==200)
{


document.getElementById('h3').style.backgroundColo r='#99CC00';

//////////////////////////////////////////////////////////////////////////////////////// Ajax#2
function call_XML()
{
creatXmlHttpRequest();
var url="Connector_DataBase.php?";
Ajax.onreadystatechange = getXML;
Ajax.open("GET",url,true);
Ajax.send(null);
}


function getXML()
{
document.getElementById('h1').style.backgroundColo r='#ffffff';

if(Ajax.readyState == 4)
{
document.getElementById('h2').style.backgroundColo r='#ffffff';

////////////////////////////////////////////////////////////////////////////////////////// ta einja dorost kar mikone
if(Ajax.status ==200)
{
////////////////////////////////////////////////////////////////////////////////////////// ein code ejra nemishe!!!!!!!!!!!!!!!
document.getElementById('h3').style.backgroundColo r='#ffffff';


document.getElementById("hh").innerHTML = Ajax.responseText;
}

}
}


call_XML();

}

}
}



//End Of Ajav Core