Nilesh Patel

Nilesh Patel

  • 1.8k
  • 304
  • 6k

Open PDF file in Jquery Dialoags

Sep 10 2018 1:58 AM
Hello,
 
Now I am try to open pdf file in jquery dialog using object data of jquery and it is working fine in chrome but not properly working in firefox.
 
I have also try using iframe but same issue is occur so please if you have any solution let me know.
 
here attached code and screen shot.

$(function () {
var fileName = "123.pdf";
$("#btnShow").click(function () {
$("#dialog").dialog({
modal: true,
title: fileName,
width: 800,
height: 600,
buttons: {
Close: function () {
$(this).dialog('close');
}
},
open: function () {
var object = "<object data=\"{FileName}#toolbar=0\" type=\"application/pdf\" width=\"775px\" height=\"450px\" ></object>";
object = object.replace(/{FileName}/g, "Files/" + fileName);
$("#dialog").html(object);
}
});
});
});
 

Attachment: file.rar

Answers (1)