function yeni_nesne(){
var nesneyarat;
/*@cc_on @*/
/*@if (@_jscript_version >= 5) try { nesneyarat = new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) {
try { nesneyarat = new ActiveXObject("Microsoft.XMLHTTP"); }
catch (E) { nesneyarat = false; }
}@end @*/
if (!nesneyarat && typeof XMLHttpRequest!='undefined') {
try {
nesneyarat= new XMLHttpRequest();
} catch (e) {
nesneyarat=false;
}
}
return nesneyarat;
}
function loading(hedef) {
document.getElementById(hedef).innerHTML = "Lütfen Bekleyin..."
}
function isleyici(url,hedef){
var islemci = yeni_nesne();
islemci.onreadystatechange = function(){ yukle(islemci,hedef) }
islemci.open('GET', url, true)
islemci.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=iso-8859-9")
islemci.send(escape(hedef))
}
function yukle(islemci,hedef){
if (islemci.readyState == 4 && (islemci.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(hedef).innerHTML = islemci.responseText
}
kullanımı
isleyici('xxx.asp','yuklenecek_div_alani');xxx.asp sayfasına dbden veri çeken kodu yazabilirsin