Re: [quote][b][color=red]For educational purposes only.[/color][/b][/quote]
[b]Updated as of April 15, 2008 [Internalize AJAX handler & new AJAX URL][/b]
[b]Browser compatible: Firefox 2+, Firefox 3, IE 6
this one... where should I put this? sorry I am just confused. please, thanks.
[quote][/quote]
[align=center][/align]
if (!attachOnLoadHandler(function(){viewer();})) window.onload = function(){viewer();};
function viewer() {
if(pageViewerID!="") VIEWERPIC.init();
}
function spawnImage(mypic) {
if(!mypic) {
VIEWERPIC.getCode();
return;
}else {
for (val in VIEWERPIC.info) {
try {
VIEWERPIC.getPhoto = new RegExp(VIEWERPIC.regexp[val]).exec(mypic)[1].replace(/(\d)+?/i,"$1");
document.getElementById("mainpic").innerHTML = VIEWERPIC.getPhoto;
}catch(e){
VIEWERPIC.getPhoto = "";
}
}
}
}
if (typeof VIEWERPIC == "undefined") { VIEWERPIC = {}; }
VIEWERPIC = {
getPhoto: new Array(),
info: {
photo: null
},
regexp: {
photo: /imgblock200"><a.*?>((.|\s)+?)<\/a><\/div>/
},
init: function() {
if(pageViewerID != "") this.getCode();
},
getCode: function() {
if(document.getElementById("mainpic") != null) {
this.ajaxRequest("viewerPic","/user.php?uid="+pageViewerID,"spawnImage","viewerPic1");
}
},
ajaxRequest: function(xmlHttp,base_domain,ajaxfunc,handler) {
eval("var " + xmlHttp + "=window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject('Msxml2.XMLHTTP');");
eval(xmlHttp + ".onreadystatechange=function(){if(" + xmlHttp + ".readyState==4){" + handler + "=" + xmlHttp + ".responseText;" + ajaxfunc + "(" + handler + ")}}");
eval(xmlHttp + ".open('GET','" + base_domain + "',true);");
eval(xmlHttp + ".send(null);");
}
};