How can I launch an external website in JQuery Mobile without leaving the application?

I am working on a PhoneGap + JQM application that allows an operator to view our website. If we do the usual target = "_blank", it launches Safari, but does not provide an easy way to return to the application.

Has anyone come up with a good way to launch an external website in JQM in a dialog box or with a closed title? So far I have filled the iframe in the dialog and it works, but it feels a bit klugey.

+3


source to share


3 answers


try this .. https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/ChildBrowser



works great for loading external link, in app

+1


source


Use dialogs . It acts like a popup where you can add whatever content you want. The user can close the popup and go back to your application. It won't be nice if the external website isn't mobile-friendly.



+2


source


Using a header with a back button and an iframe with an external site works great for me. You can also have a button in the title "Exit" or something similar that will take you to another JQM page.

<div data-role="page" id="pageExternalSite" data-add-back-btn="true">
    <div data-role="header">
        <h1>example.com</h1>
    </div>
    <div data-role="content">
        <iframe src="http://example.com/"></iframe>
    </div>
</div>

      

+2


source







All Articles