|
Revision 7573, 1.3 kB
(checked in by jburke, 21 months ago)
|
|
(merge from 0.4 branch) Some adjustments to make tests xdomain friendly
|
| Line | |
|---|
| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <script language="JavaScript" type="text/javascript"> |
|---|
| 4 | |
|---|
| 5 | djConfig = { |
|---|
| 6 | isDebug: true, |
|---|
| 7 | dojoIframeHistoryUrl: "../../iframe_history.html" |
|---|
| 8 | }; |
|---|
| 9 | </script> |
|---|
| 10 | <script language="JavaScript" type="text/javascript" |
|---|
| 11 | src="../../dojo.js"></script> |
|---|
| 12 | <script language="JavaScript" type="text/javascript"> |
|---|
| 13 | dojo.require("dojo.io.IframeIO"); |
|---|
| 14 | |
|---|
| 15 | var ctr = 0; |
|---|
| 16 | var foo; |
|---|
| 17 | |
|---|
| 18 | function sendIt(){ |
|---|
| 19 | var bindArgs = { |
|---|
| 20 | formNode: document.getElementById("uploadForm"), |
|---|
| 21 | mimetype: "text/javascript", |
|---|
| 22 | content: { |
|---|
| 23 | increment: ctr++, |
|---|
| 24 | fileFields: "ul1" |
|---|
| 25 | }, |
|---|
| 26 | handler: function(type, data, evt){ |
|---|
| 27 | dojo.debug("Type:", type); |
|---|
| 28 | dojo.debug("Response:", data); |
|---|
| 29 | foo = evt; |
|---|
| 30 | } |
|---|
| 31 | }; |
|---|
| 32 | var request = dojo.io.bind(bindArgs); |
|---|
| 33 | } |
|---|
| 34 | </script> |
|---|
| 35 | </head> |
|---|
| 36 | <body> |
|---|
| 37 | <p> |
|---|
| 38 | <b>Note:</b> This test makes a form POST to upload.cgi. This cgi needs to be made executable for this test to work, and it won't work from local disk. |
|---|
| 39 | </p> |
|---|
| 40 | <form action="upload.cgi" id="uploadForm" |
|---|
| 41 | method="POST" enctype="multipart/form-data"> |
|---|
| 42 | <input type="text" name="foo" value="bar"> |
|---|
| 43 | <input type="file" name="ul1"> |
|---|
| 44 | <input type="button" onclick="sendIt();" value="send it!"> |
|---|
| 45 | </form> |
|---|
| 46 | </body> |
|---|
| 47 | </html> |
|---|