אשכול: AJAXולולאות
View Single Post
ישן 17-09-07, 19:00   # 5
NoMore
מתאורר / יצא בחוץ
 
מיני פרופיל
תאריך הצטרפות: Jul 2006
הודעות: 54

NoMore לא מחובר  

אי אפשר לערוך :\
אני התקדמתי קצת, אני מצליח לגרום לפלט לצאת לspan ולinput
אבל אני יכול לגרום לפלט לצאת למשתנה בJS?
הקוד שלי:
קוד:
var http;
function engine(){
    var http=null;
    try{
        // Firefox, Opera 8.0+, Safari
        http=new XMLHttpRequest();
    } catch(e){
        try{
            // Internet Explorer
            http=new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e){
            // Internet Explorer
            http=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return http;
}
function ready(){
	if(http.readyState==4){
       document.getElementById("output").innerHTML=http.responseText;
    }
}
function send(i){
    http=engine();
    if(http==null){
        alert("Your browser does not support AJAX!");
        return;
    } 
    http.onreadystatechange=ready;
    http.open("GET","out.php?i=" + i,true);
    http.send(null);
}
הפונקציה send מופעלת בonLoad של הbody
  Reply With Quote