Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

XMLHttpRequest do petition (See related posts)

   1  
   2  function loadXMLDoc(url) {
   3  		
   4      // branch for native XMLHttpRequest object
   5      if (window.XMLHttpRequest) {
   6      
   7          req = new XMLHttpRequest();
   8          //function_name is the function to process request
   9          req.onreadystatechange = function_name;
  10          req.open("GET", url, true);
  11          req.send(null);
  12          
  13      // branch for IE/Windows ActiveX version
  14      } else if (window.ActiveXObject) {
  15      
  16          req = new ActiveXObject("Microsoft.XMLHTTP");
  17          if (req) {
  18  
  19              //function_name is the function to process request        
  20              req.onreadystatechange = actualizarLista;
  21              req.open("GET", url, true);
  22              req.send();
  23          }
  24      }
  25  }

You need to create an account or log in to post comments to this site.


Click here to browse all 5309 code snippets

Related Posts