Download a pdf file using Jquery -


i want download pdf file using jquery, code works correctly little irritating problem pdf file loads browser instead of giving saveas dialog, don't know how solve code that

var timeout; $(document).on("click", "#downloadbtn", function(e){ cleartimeout(timeout); var textname = $('input[name=txtdatecheck]').val(); var optionselect = $('input[name=timeselected]').val(); settimeout(function() {     $.ajax({         type: 'post',         url: "checkurl.php",         data: { checkurl: textname, optionid: optionselect},         datatype: 'text',         success: function(response) { //alert(response); e.preventdefault(); //window.open(response.trim(), '_blank'); window.location.href = response.trim();         }     }); }, 200); }); 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -