Showing with 16 additions and 9 deletions.
  1. +5 −2 docs/api/globalconfig.html
  2. +11 −7 docs/pages/phonegap.html
@@ -91,6 +91,9 @@ <h2>Configurable options</h2>
<dt><code>autoInitializePage</code> <em>boolean</em>, default: true</dt>
<dd>When the DOM is ready, the framework should automatically call <code>$.mobile.initializePage</code>. If false, the page will not initialize and will be visually hidden until <code>$.mobile.initializePage</code> is manually called.</dd>

<dt><code>buttonMarkup.hoverDelay</code> <em>integer</em>, default: 200</dt>
<dd>Set the delay for touch devices to add the hover and down classes on touch interactions for buttons throughout the framework. Reducing the delay here results in a more responsive feeling ui, but will often result in the downstate being applied during page scrolling.</dd>

<dt><code>defaultDialogTransition</code> <em>string</em>, default: 'pop'</dt>
<dd>Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions.</dd>

@@ -132,10 +135,10 @@ <h2>Configurable options</h2>

<dt><code>pageLoadErrorMessage</code> <em>string</em>, default: "Error Loading Page"</dt>
<dd>Set the text that appears when a page fails to load through Ajax.</dd>

<dt><code>pageLoadErrorMessageTheme</code> <em>string</em>, default: "e"</dt>
<dd>Set the theme that the error message box uses.</dd>

<dt><code>pushStateEnabled</code> <em>boolean</em>, default: true</dt>
<dd>Enhancement to use <code>history.replaceState</code> in supported browsers, to convert the hash-based Ajax URL into the full document path. Note that we <a href="../pages/page-navmodel.html">recommend</a> disabling this feature if Ajax is disabled or if extensive use of external links are used.</dd>

@@ -24,14 +24,14 @@ <h1>PhoneGap apps</h1>

<div data-role="content">
<div class="content-primary">


<h2>Building PhoneGap apps with jQuery Mobile</h2>

<p><a href="http://phonegap.com/" rel="external">PhoneGap</a> is an HTML5 app platform that allows developers to author native applications with web technologies and get access to APIs and app stores. Applications are built as normal HTML pages and packaged up to run as a native application within a UIWebView or WebView (a chromeless browser, referred to hereafter as a webview). Since PhoneGap is frequently used in conjunction with jQuery Mobile, we wanted to offer a few tips and recommendations to help you get staretd. </p>

<p>The initial application document is loaded by the PhoneGap application by a local file:// URL. This means that if you want to pull in pages from your company's remote server (phone home) you will have to refer to them with absolute URLs to your server. Because your document originates from a file:// URL, loading pages or assets from your remote server is considered a cross-domain request that can be blocked in certain scenarios. </p>

<p>Your ability to access cross-domain pages from within a Phone Gap jQuery Mobile application is controlled by two key things: <code>$.support.cors</code> and <code>$.mobile.allowCrossDomainPages</code>, and can also be influenced by the white list feature in later builds of PhoneGap.</p>

<h2>$.support.cors</h2>
@@ -40,6 +40,10 @@ <h2>$.support.cors</h2>

<p>Since jQuery Mobile relies on jQuery core's $.ajax() functionality, <code>$.support.cors</code> must be set to <code>true</code> to tell <code>$.ajax</code> to load cross-domain pages. We've heard reports that webviews on some platforms, like BlackBerry, support cross-domain loading, but that jQuery core incorrectly sets <code>$.support.cors</code> value to <code>false</code> which disables cross-domain $.ajax() requests and will cause the page or assets to fail to load. </p>

<h2>$.mobile.buttonMarkup.hoverDelay</h2>

<p>If you find that the button down/hover state (lists, buttons, links etc) feels sluggish the <code>$.mobile.buttonMarkup.hoverDelay</code> setting might be of use. It will decrease the time between the touch event and the application of the relevant class but will also result in a higher chance that the same class will be applied even when the user is scrolling (eg, over a long list of links).</p>

<h2>$.mobile.allowCrossDomainPages</h2>

<p>When jQuery Mobile attempts to load an external page, the request runs through <code>$.mobile.loadPage()</code>. This will only allow cross-domain requests if the <code>$.mobile.allowCrossDomainPages</code> configuration option is set to <code>true</code>. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for <code>$.mobile.allowCrossDomainPages</code> is set to <code>false</code>.</p>
@@ -67,9 +71,9 @@ <h2>Still having issues?</h2>
<p><strong>Android enforces a timeout when loading URLs in a webview</strong> which may be too short for your needs. You can change this timeout by editing a Java class generated by the Eclipse plugin for Android:</p>

<code>super.setIntegerProperty("loadUrlTimeoutValue", 60000);</code>



</div>
<!--/content-primary -->