| <!doctype html> |
| <html> |
| <head> |
| <title>easyXDM</title> |
| <script type="text/javascript" src="../easyXDM.debug.js"> |
| </script> |
| <script type="text/javascript"> |
| /** |
| * Request the use of the JSON object |
| */ |
| easyXDM.DomHelper.requiresJSON("../json2.js"); |
| </script> |
| <script type="text/javascript"> |
| |
| // this is just some bootstrapping code in order to provide |
| // the correct host name depending on where it is being run. |
| var REMOTE = (function(){ |
| var remote = location.href; |
| switch (location.host) { |
| case "provider.easyxdm.net": |
| location.href = remote.replace("provider", "consumer"); |
| break; |
| case "easyxdm.net": |
| remote = remote.replace("easyxdm.net", "consumer.easyxdm.net"); |
| break; |
| case "consumer.easyxdm.net": |
| remote = remote.replace("consumer", "provider"); |
| break; |
| case "xdm1": |
| remote = remote.replace("xdm1", "xdm2"); |
| break; |
| } |
| return remote.substring(0, remote.lastIndexOf("/")); |
| }()); |
| |
| |
| |
| var btn; |
| var remote = new easyXDM.Rpc({ |
| remote: REMOTE + "/upload_rpc.html", |
| swf: REMOTE + "/../easyxdm.swf", |
| onReady: function(){ |
| //display the upload form |
| var frm = document.getElementById("frmUpload"); |
| frm.action = REMOTE + "/upload_handler.aspx"; |
| frm.style.display = "block"; |
| btn = document.getElementById("btnSubmit"); |
| |
| frm.onsubmit = function(){ |
| btn.disabled = "disabled"; |
| }; |
| } |
| }, { |
| local: { |
| returnUploadResponse: function(response){ |
| // here you should call back into your regular workflow |
| btn.disabled = null; |
| alert(response.msg); |
| } |
| } |
| }); |
| </script> |
| </head> |
| <body> |
| <div style="border:1px solid black;padding:3px;margin:10px;"> |
| <a href="index.html">Index of examples</a> |
| | <a href="http://github.com/oyvindkinsey/easyXDM/#readme">Readme at github</a> |
| | |
| | <a href="http://easyxdm.net/">easyXDM.net</a> |
| | <a href="http://groups.google.com/group/easyxdm">easyXDM at Google Groups</a> |
| <br/> |
| The examples are executing slower than the production build due to the extensive tracing. |
| <br/> |
| If you are alerted about a popup, then this is only the trace log feature. You can ignore this. |
| </div> |
| <!-- easyXDM.Debug.trace(msg) will output its messages to any element with the id "log" --> |
| <div id="log" style="height:100px;border:1px dotted black;overflow:auto"> |
| </div> |
| <form id="frmUpload" style="display:none" method="POST" target="upload_target" enctype="multipart/form-data"> |
| <input type="file" name="upload_file"/><input type="submit" id="btnSubmit" value="Upload file"/> |
| </form><!-- |
| tracking code |
| --> |
| <script type="text/javascript"> |
| var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| </script> |
| <script type="text/javascript"> |
| if (location.host.indexOf("easyxdm.net") !== -1) { |
| try { |
| var pageTracker = _gat._getTracker("UA-9535591-3"); |
| pageTracker._setDomainName(".easyxdm.net"); |
| pageTracker._trackPageview(); |
| } |
| catch (err) { |
| } |
| } |
| </script> |
| </body> |
| </html> |