Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Uploading files using jquery form
  2. $(document).ready(function() {
  3.     var options = {
  4.         target:        '#output1',   // target element(s) to be updated with server response
  5.         beforeSubmit:  showRequest,  // pre-submit callback
  6.         success:       showResponse  // post-submit callback <-- See here
  7.     };
  8.  
  9.     // bind form using 'ajaxForm'
  10.     $('#myForm1').ajaxForm(options);
  11. });
  12.  
  13. function showResponse(responseText, statusText, xhr, $form) {
  14.   alert(responseText);
  15. }