All pastes #115570 Raw Edit

Mine

public text v1 · immutable
·published 2006-08-04 18:17 UTC
rendered paste body
   function kur() {
   try {

     xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  // yeni versiyon xmlhttp

   } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");  // eski versiyon xmlhttp

      } catch (e) {

        xmlhttp = false;

      }

   }

   // Mozilla veya Safari ise
   if ( !xmlhttp && typeof XMLHttpRequest != 'undefined' ) {

     try{

        xmlhttp = new XMLHttpRequest();
     
     }catch(e) {
     
        xmlhttp = false;

     }

   }

   // Diger

   if ( !xmlhttp && window.createRequest ) {

     try{

        xmlhttp = window.createRequest();
     
     }catch(e) {
     
        xmlhttp = false;

     }

   }
}


function ajaxpage(url, containerid){
kur();
  // istegimizi olusturuyoruz
xmlhttp.open('GET', url, true)

document.getElementById(containerid).innerHTML='<div class="yukleniyor"><img src="templates/img/main/yukleniyor.gif" width="16" height="16"><br><img src="templates/img/main/icerik_yukleniyor.gif" width="170" height="44" vspace="20"></div>';
if (xmlhttp.readyState == 4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=xmlhttp.responseText

  // durumu yukleyiciyi belirliyoruz
  xmlhttp.onreadystatechange = function (){
    if( xmlhttp.readyState == 4 ){
         document.getElementById(containerid).innerHTML = xmlhttp.responseText;
    }
  }
  
  // istegi gonderiyoruz
  xmlhttp.send(null);
}