Reputation: 3296
I want to open any pdf file links to new browser window. The following jquery code works fine except in firefox which opens file save dialog.
jQuery(function($) {
$('a[href$=".pdf"]').attr('target', '_blank');
});
can we possibly force firefox to open the document like chrome?
Upvotes: 0
Views: 1111
Reputation: 2804
David is right. The browser behavior for opening certain MIME types, like PDF varies according to browsers, browser versions, operating systems, etc. You can even force the download of the resource, instead of visualizing it. In conclusion, that's something out of our control.
Upvotes: 1