Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <
- <script type="text/javascript">
- function ejecutarAJAX()
- {
- var ajaxRequest;
- if(window.XMLHttpRequest){ //navegadores tipo chrome
- ajaxRequest = new XMLHttpRequest();
- }else{ //navegadores antiguos (ie)
- ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
- }
- //0 Petición no ha sido inicializada
- //1 Petición no ha sido establecida
- //2 Petición no ha sido enviada
- //3 Petición esta siendo procesada
- //4 Petición ha sido finalizada
- var ajaxRequest = new XMLHttpRequest();
- ajaxRequest.onreadystatechange = function(){
- if(ajaxRequest.readyState == 4 && ajaxRequest.status == 200){
- document.getElementById("info").innerHTML = ajaxRequest.responseText;
- }
- }
- ajaxRequest.open("GET", "documento.txt", true);
- ajaxRequest.send();
- }
- </script>
Add Comment
Please, Sign In to add comment