问题
Am using
window.open(url, '_blank', 'location=no')
to open external web page, wherein that web page contains pdf file links. The problem am facing is these pdf links are not working within that browser.
If I use
window.open(url, '_blank', 'location=yes')
or
window.open(url, '_blank')
is working as expected. In this scenario everything is working fine.
But since my requirement is to hide the address bar, am giving location=no
as argument to window.open()
. Here pdf links are not working inside web page which is opened via
window.open(url, '_blank', 'location=no')
How can I resolve this issue? Please give suggestions.
回答1:
Try this::
$(".drawListItem").on("click",function(){
var url = 'https://www.google.co.in';
window.open("https://docs.google.com/gview?embedded=true&url="+url,"_blank","location=yes");
});
来源:https://stackoverflow.com/questions/24670002/pdf-file-urls-are-not-working-in-phonegap