function GetXMLHttp() { var xmlHttp; try { xmlHttp = new XMLHttpRequest(); } catch(ee) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttp = false; } } } return xmlHttp; } var xmlRequest = GetXMLHttp(); function abrirPag(valor,location){ var url = valor; var loc = location; xmlRequest.onreadystatechange = mudancaEstado; xmlRequest.open("GET", "comments.php?location=" + loc + "&id=" + url, true); xmlRequest.send(null); if (xmlRequest.readyState == 1) { document.getElementById("comments").innerHTML = "<img src='loader.gif'>"; } return loc; return url; } function mudancaEstado(){ if (xmlRequest.readyState == 4){ document.getElementById("comments").innerHTML = xmlRequest.responseText; } }
o que queria eh q quando for clicar no link que vai colocar o comments.php(..) na div "comments", vai ter algo na div já, entao keria q limpace e colocasse oq vai vir pelo comments.php, o que teria que mudar ae?
Obrigado desde já.