Book Image

JavaScript Mobile Application Development

Book Image

JavaScript Mobile Application Development

Overview of this book

Table of Contents (15 chapters)
JavaScript Mobile Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

InAppBrowser


The InAppBrowser plugin can provide a web browser view that is displayed when calling the window.open() function or when opening a link formed as <a target="_blank">.

In order to use the InAppBrowser plugin in our Apache Cordova project, we need to use the following cordova plugin add command:

> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

Demo

In order to access the InAppBrowser demo, you can click on the InAppBrowser list item. You will be introduced to the InAppBrowser page. As shown in the following screenshot, you can click on the Open and Close web page button in order to open the http://www.google.com/ web page using InAppBrowser. Note that the opened web page will be closed after 10 seconds.

Opening an external page using InAppBrowser

The HTML page

The following code snippet shows the "inAppBrowser" page:

<div data-role="page" id="inAppBrowser">
    <div data-role="header">
        <h1>InAppBrowser&lt...