Pdf file url's are not working in phonegap

久未见 提交于 2019-12-13 09:46:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!