Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Pessoal tenho este script em ajax mas minha duvida acho que é em javascript mesmo:
function pesquisar_dominio_whois(dominio,extensao){ if (dominio != ""){ http.open("GET", "inc/pesquisar.dominio.whois.php?dominio=" + dominio + extensao, true); http.onreadystatechange = handleHttpResponse_dominio_whois; http.send(null); } else { alert('Você deve digitar o nome do dominio!');}}function handleHttpResponse_dominio_whois(){ if (http.readyState == 4) { results = http.responseText; if (results == "1"){ alert('Ja registrado"'); document.getElementById( 'whois_livre' ).style.display = "none"; document.getElementById( 'whois_registrado' ).style.display = "block"; } else { document.getElementById( 'whois_registrado' ).style.display = "none"; document.getElementById( 'whois_livre' ).style.display = "block"; } }}Nao estou conseguindo usar a variavel dominio e extesao na funcao de baixo a function handleHttpResponse_dominio_whois() como posso fazer isso? pois queria por assim:
function handleHttpResponse_dominio_whois()
{
if (http.readyState == 4) {
results = http.responseText;
if (results == "1"){
alert('Ja registrado"');
document.getElementById( 'whois_livre' ).style.display = "none";
document.getElementById( 'whois_registrado' ).style.display = "block";
**document.getElementById( 'whois_registrado' ).innerHTML = "<div>dominio</div>";**
} else {
document.getElementById( 'whois_registrado' ).style.display = "none";
document.getElementById( 'whois_livre' ).style.display = "block";
**document.getElementById( 'whois_livre' ).innerHTML = "<div>dominio</div>";**
}
}
}Carregando comentários...