Over a million developers have joined DZone.

iOS 9, Cordova, and jQuery Mobile Apps Integration Tips

DZone's Guide to

iOS 9, Cordova, and jQuery Mobile Apps Integration Tips

Sometimes innocent OS updates can trip you up. Here's how to get around the latest gotchas with iOS9.

· Mobile Zone
Free Resource

Unfortunately after having iOS 9 update, you may find your Cordova jQuery mobile app has the following problems:

  1. All of your app’s popups are suddenly closed after the first opening time!
  2. All your app’s back button are not working anymore!

The root cause of these problems is a bug in iOS9 UIWebView‘s window.location.hash as shown in the link below:


In order to fix these issues, you can do the following workarounds.

Fixing the sudden closing pop-up

In order to fix this issue, make sure to set the data-history attribute of jQuery mobile popup to "false". An example of this is shown in the link below:

Fixing the broken back button

In order to fix this issue, make sure to disable the hash listening behaviour for jQuery mobile when the device is ready. You need to be careful when applying this fix, make sure that this fix will be applied for only iOS version 9 as shown in the code snippet below.

if (device.platform === "iOS"  && parseInt(device.version) === 9) {
} /* when the device is ready */

Checking a working Cordova jQuery mobile app in iOS 9

Finally, you can check a complete working Cordova jQuery mobile app in iOS 9. This app is one of the examples of the “JavaScript Mobile Application Development” book which can be reached at:

The example app uses Apache Cordova 5.3.3 and jQM 1.4.5. Enjoy!

cordova ,ios9

Published at DZone with permission of Hazem Saleh, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}