Você está na página 1de 1

G:\JavaScript\Ajax\Cpia de Sistema de Login com XML\login.

js

sexta-feira, 27 de janeiro de 2012 16:39

function CriaAjax() { //A ordem de criao sempre essa IE7-, IE8 e outros var xmlhttp; try { //Para o Internet Explorer 7 ou menos xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { try { //IE8 xmlhttp = getXMLHTTP(); } catch(ex) { try { //Para todos os outros Browsers (Firefox, Opera, Chrome, etc ...) xmlhttp = new XMLHttpRequest(); } catch(exc) { alert("Seu navegador no tem recursos para uso de Ajax" ); xmlhttp = null; } } } return xmlhttp; } var Ajax = new CriaAjax(); function ExecAjax(pagina){ Ajax.open('get',pagina,true); Ajax.onreadystatechange = Processar; Ajax.send(null); } function Processar(){ // while (Ajax.responseText < 4) { document.getElementById('corpo').innerHTML = "<img src='img/loading.gif' alt='Carregando'/>"; if (Ajax.readyState == 4) { document.getElementById('corpo').innerHTML = Ajax.responseText; } }

-1-

Você também pode gostar