在Cordova 3.6中使用iframe和jquery mobile对话框弹出窗口使用google文档查看器显示文档
我试图在google doc viewer中显示文本文档,google doc viewer位于iframe中,iframe位于jquery mobile对话框中。我正在使用cordova 3.6,并在iOS上试用 以下是我目前的代码:在Cordova 3.6中使用iframe和jquery mobile对话框弹出窗口使用google文档查看器显示文档,jquery,jquery-mobile,cordova,iframe,jquery-ui-dialog,Jquery,Jquery Mobile,Cordova,Iframe,Jquery Ui Dialog,我试图在google doc viewer中显示文本文档,google doc viewer位于iframe中,iframe位于jquery mobile对话框中。我正在使用cordova 3.6,并在iOS上试用 以下是我目前的代码: <div data-role="page" id="dialog"> <iframe id="myIframe" src="" style="width: 100%; height: 100%;" ></iframe> <
<div data-role="page" id="dialog">
<iframe id="myIframe" src="" style="width: 100%; height: 100%;" ></iframe>
</div>
<button href="foo.html" id="opener" data-rel="dialog" data-transition="pop">Open Dialog</button>
打开对话框
职能:
<script>
$(function () {
$("#dialog").dialog({
autoOpen: false,
show: "fade",
hide: "fade",
modal: true,
open: function (ev, ui) {
$('#myIframe').src = 'http://docs.google.com/viewer?url=http://www.relacweb.org/conferencia/images/documentos/Hoteles_cerca.pdf';
},
height: 'auto',
width: 'auto',
resizable: true
// title: 'Vessels'
});
$("#opener").click(function () {
$("#dialog").dialog("open");
return false;
});
</script>
$(函数(){
$(“#对话框”)。对话框({
自动打开:错误,
显示:“褪色”,
隐藏:“褪色”,
莫代尔:是的,
打开:功能(ev、ui){
$('#myIframe').src='1〕http://docs.google.com/viewer?url=http://www.relacweb.org/conferencia/images/documentos/Hoteles_cerca.pdf';
},
高度:“自动”,
宽度:“自动”,
可调整大小:true
//标题:“船舶”
});
$(“#开场白”)。单击(函数(){
$(“对话框”)。对话框(“打开”);
返回false;
});
使用jquery:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
在浏览器上,这可以根据需要工作,但在Cordova上不工作。iframe已经加载了pdf,单击按钮时什么也没有发生。那么这是不可能的还是我遗漏了什么
谢谢。您可以使用前面讨论过的inappbrowser插件 最好的
M关于使用phonegap打开pdf,请查看此内容()@mboeckle我在放置qstn之前看到了该线程,正如我所说,这在浏览器上有效,但在cordova应用程序中无效,因此我不确定我遗漏了什么。您好-也许您使用JS pdf查看器和jquery mobile弹出窗口的组合()@mboeckle嗨!现在我正在使用google doc viewer inside和iframe,iframe在
data role=“page”
中显示良好。但是现在在查看器底部有一个“下载”链接,可以在应用程序webview中打开实际的pdf,我想知道如何取出它吗?我猜你必须使用iApp浏览器-