Display documents using google doc viewer using iframe and jquery mobile popup dialog in Cordoba 3.6

I am trying to display text documents inside a google doc viewer, which is inside an iframe, which is then inside the jquery mobile dialog. I use cordova 3.6 and try this on iOS.

Here is my code:

<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>

features:

<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>

Used by 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>

In a browser, this works on demand, but not in Cordoba. IFrame is already loaded pdf, and nothing happens when a button is clicked. So is it just impossible or am I missing something?

Thank.

+1
source share
1 answer

inappbrowser, .

M

+1

Source: https://habr.com/ru/post/1529973/


All Articles