xip.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title>XHR IFrame Proxy Tests</title>
  6. <style type="text/css">
  7. @import "../../../../dojo/resources/dojo.css";
  8. @import "../../../../dijit/themes/tundra/tundra.css";
  9. @import "../../../../dijit/themes/dijit.css";
  10. </style>
  11. <script type="text/javascript" src="../../../../dojo/dojo.js"
  12. djConfig="isDebug:true"></script>
  13. <script type="text/javascript" src="../xip.js"></script>
  14. <script type="text/javascript">
  15. dojo.require("dojox.io.proxy.xip");
  16. function testXmlGet(){
  17. /*
  18. //Normal xhrGet call.
  19. dojo.xhrGet({
  20. url: "frag.xml",
  21. handleAs: "xml",
  22. load: function(result, ioArgs){
  23. var foo = result.getElementsByTagName("foo").item(0);
  24. dojo.byId("xmlGetOut").innerHTML = "Success: First foobar value is: " + foo.firstChild.nodeValue;
  25. }
  26. });
  27. */
  28. //xip xhrGet call.
  29. dojo.xhrGet({
  30. iframeProxyUrl: "../xip_server.html",
  31. url: "tests/frag.xml",
  32. handleAs: "xml",
  33. load: function(result, ioArgs){
  34. var foo = result.getElementsByTagName("foo").item(0);
  35. dojo.byId("xmlGetOut").innerHTML = "Success: First foobar value is: " + foo.firstChild.nodeValue;
  36. }
  37. });
  38. }
  39. dojo.addOnLoad(function(){
  40. });
  41. </script>
  42. </head>
  43. <body class="tundra">
  44. <h1>XHR IFrame Proxy Tests</h1>
  45. <p>Run this test from a web server, not from local disk.</p>
  46. <p>
  47. <button onclick="testXmlGet()">Test XML GET</button>
  48. </p>
  49. <div id="xmlGetOut"></div>
  50. </body>
  51. </html>