function ajax(request, target) { var xmlhttp=false; //Clear our fetching variable try { xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object } catch (e) { try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest } xmlhttp.open('GET', request, true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { //Check if it is ready to recieve data var content = xmlhttp.responseText; //Load content to js variable if( content ) { document.getElementById(target).innerHTML = content; } } } xmlhttp.send(null) //Nullify the XMLHttpRequest return; } function exampleFunction() { ajax('ajax.___.php?exampleVar=' + escape(document.getElementById('exampleField').value),'exampleBox'); } function personalPerfil(id, color) { center = document.body.clientWidth / 2; posLeft = 590; window.open("/_srv/personalPerfil.php?id=" + id + "&color=" + color, "_blank", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=310,height=500,left=" + posLeft + ",top=270"); }