Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
49
rated 0 times [  53] [ 4]  / answers: 1 / hits: 25087  / 12 Years ago, fri, december 21, 2012, 12:00:00

How to open the PDF file using AJAX
I tried this



$.ajax({

type : 'GET',
url : ApplicationParameters.getWebRoot() + 'E_Books/pdf/previews/' + jsonRecord[0].previewUrl,
data : strJsonParam,
dataType : 'text',
contentType : 'application/pdf',

success: function(data){
var opn = open(/E_Books/pdf/previews/+jsonRecord[0].previewUrl);
displayBook(opn);
ebookStore.add(opn);
ebookStore.sync();
}
...


it open pdf file but I want open that in same window.it open in another window.
help please


More From » ajax

 Answers
9

Replace your code with this:



            type : 'GET',
url : ApplicationParameters.getWebRoot() + 'E_Books/pdf/previews/' + jsonRecord[0].previewUrl,
data : strJsonParam,
dataType : 'text',
contentType : 'application/pdf',

success: function(data){
var opn = open(/E_Books/pdf/previews/+jsonRecord[0].previewUrl, _self);
displayBook(opn);
ebookStore.add(opn);
ebookStore.sync();
}

[#81289] Thursday, December 20, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ammonjesseg

Total Points: 170
Total Questions: 110
Total Answers: 98

Location: Benin
Member since Fri, Mar 24, 2023
1 Year ago
;