Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    
  2.             jQuery(document).ready(function() {
  3.                 jQuery('#form-cliente-unaccon').submit(function() {
  4.                     // show loader [optional line]
  5.                     $('#msgs').html('Enviando....').fadeIn();
  6.                     if (document.getElementById('upload_frames') == null) {
  7.                         // create iframe
  8.                         $('body').append('<iframe id="upload_frames" name="upload_frames"></iframe>');
  9.                         $('#upload_frames').on('load', function() {
  10.                     if ($(this).contents()[0].location.href.match($(this).parent('form').attr('action'))) {
  11.                                
  12.  
  13.                                 $('#server_responses').html($(this).contents().find('html').html());
  14.                                
  15.                                 $('#msgs').hide();
  16.                             }
  17.                         })
  18.  
  19.                         $(this).attr('method', 'post');
  20.                         $(this).attr('enctype', 'multipart/form-data');
  21.  
  22.                         $(this).attr('target', 'upload_frames').submit();
  23.                     }
  24.  
  25.                 });
  26.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement