Ok, Let\'s say I have document data stored somewhere, let\'s arbitrarily take this pdf.
Issue #1. What I want to do is make an AJAX call to this URL (because I need
var src_url = your url here;
var contentDisposition = 'AlwaysInline';
var src_new = src_url.replace(/(ContentDisposition=).*?(&)/, '$1' + contentDisposition + '$2');
By doing this you will be able to view pdf instead of downloading it,
Header ContentDisposition should be 'AlwaysInline' then only it displays your file instead of downloading it.