Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. CSS:
  2. div.ajax-progress {
  3. //some setting and url
  4. }
  5. <body>
  6. <div class="ajax-progress"></div>
  7. </body>
  8. Javascript:
  9.  
  10. $('#fileToUpload').on('change', function(e) {
  11.  
  12. var file = e.target.files[0];
  13. var formData = new FormData($('form')[0]);
  14. imageId = cornerstoneWADOImageLoader.fileManager.add(file);
  15.  
  16.  
  17. $.ajax({
  18. url: 'loadfile.php',
  19. type: 'POST',
  20. data: formData,
  21. async: false,
  22. dataType: 'json',
  23. timeout : 60000,
  24. beforeSend :function(){
  25. $(".ajax-progress").show();
  26. },
  27. success: function (html) {
  28. $(".ajax-progress").hide();
  29. //doing something}
  30. });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement