How to display pdf ( or any document) from server in a new browser window through ajax call
问题 How to render the documents in a new browser window using an ajax call to server. So far, I've done the following. Step 1: make an ajax call to server on button click and passing the filename: $(document).ready( function(){ $('#clickme').click(function(){ $.ajax({ type:"GET", url:"App/getfile", data:{'filename':'D:\\sample.pdf'} }).done(function(msg){ var wind = window.open("_blank"); wind.document.write(msg); }); }); } ); step 2: I am using spring controller on the server side: package my