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

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 12  |  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. downloading a file using jquery stop browser following?
  2. $('#4').change(function () {
  3.         var name = this.value;
  4.         if (name !== "") {
  5.             if (confirm("Are you sure you want to download " + name)) {
  6.                 $.ajax({
  7.                     url: '/uploads/4/' + name,
  8.                     type: 'HEAD',
  9.                     error: function () { },
  10.                     success: function () {
  11.                         window.location.href = '/uploads/4/' + name;
  12.                     }
  13.                 });
  14.             }
  15.         }
  16.     });
  17.        
  18. success: function () {
  19.                    window.open(window.location.host+ '/uploads/docs/' + name );
  20.                 }