File: example.html

Recommend this page to a friend!
  Classes of Archzilon Eshun-Davies   xhr   example.html   Download  
File: example.html
Role: Example script
Content type: text/plain
Description: Example Usage
Class: xhr
Send AJAX requests with the XMLHttpRequest objects
Author: By
Last change:
Date: 12 years ago
Size: 791 bytes


Class file image Download
<!Doctype html> <html> <head> <title>xhr test</title> <script src="xhr.js" type="text/javascript"></script> <script> function showtext() { a$.xhr("xhr.js", function() { document.getElementById('asi').innerHTML = "<pre>"+resp+"</pre>"; }); } function showimage() { a$.xhr("xhr.js", {callback:function() { document.getElementById('asi').innerHTML = "<pre>"+resp+"</pre>"; }, async: true, method: "get"}); } </script> </head> <body> <section> <input type="button" value="Load JS code" onclick="showtext();" /> <div id="sst"></div> <input type="button" value="Load Image" onclick="showimage();" /> <div id="asi" style="height:170px;overflow:scroll;"></div> </section> </body> </html>