Guest User

Untitled

a guest
Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // JSP file returned from backend
  2. <html>
  3. <body>
  4. <textarea>
  5. ${errors}
  6. </textarea>
  7. </body>
  8. </html>
  9.  
  10. // js iframe posting.
  11.  
  12.  
  13. function ioIframeGetJson(postUrl){
  14.  
  15. var td = dojo.io.iframe.send({
  16.  
  17. url: postUrl,
  18. form: "importForm",
  19. method: "post",
  20. content: {
  21. name: "uploadedfile" // file name in the form
  22. },
  23. timeoutSeconds: 20,
  24. preventCache: true,
  25. handleAs: "json",
  26. handle: function(res){
  27. if(res.$errors) {
  28. alert("SUCCESS");
  29. } else
  30. alert('Error1');
  31. },
  32. error: function (res) {
  33. alert('Error2');
  34. }
  35. });
  36. }
Add Comment
Please, Sign In to add comment