jQuery Mobile not working on Android 5.0+ devices that have Android System WebView 45.0.2454.95 installed

292
November 21, 2016, at 7:19 PM

We have this problem where our application has stopped working on Android 5.0+ devices since the Google released the latest version of Android System WebView 45.0.2454.95. If we disable this version of the WebView by going to the device settings, apps, Android System WebView and clicking Disable: the application works again. However this is not satisfactory for some of our customers and we really need to find a fix where it works with the latest version of Android System WebView.

Our application makes heavy use of jQuery and jQuery Mobile. We currently use jQuery 1.7.1 and jQuery Mobile 1.1.0. We can’t easily upgrade to a newer version.

When a page loads up in the application any method called inside a jQuery selector doesn’t run, e.g.

$(function() { //Your code here });

This code successfully executes when the old version of the WebView is used but not when the latest version is used. Attempting to call the code outside the selector has resulted in other problems.

During my investigations so far, I have discovered the problem seems to come from something in jQuery Mobile as when I remove the reference to jquery.mobile.js, the code then executes again. However as you might expect the problems then occur due to jQuery Mobile being an integral part of our application.

Does anyone know of any issues with jQuery Mobile on the latest version of Android System WebView that could be causing this?

Answer 1
$.mobile.pushStateEnabled=false;

Example:

<script type="text/javascript">
$( document ).ready(function() {
    $.mobile.pushStateEnabled = false;
});
</script>
Answer 2
<script type="text/javascript">
$(document).bind("mobileinit", function(){
    $.mobile.pushStateEnabled = false;
});
</script>
<script src="jquery-mobile.js"></script>
Rent Charter Buses Company
READ ALSO
How to send AntiForgeryToken (CSRF) along with FormData via jquery ajax

How to send AntiForgeryToken (CSRF) along with FormData via jquery ajax

So I want to POST fileUpload along with AntiForgeryToken via AJAX. Here's my code :.

674
How do I retain disabled checkboxes upon postback?

How do I retain disabled checkboxes upon postback?

I have this set of javascript codes which allows me to disable/enable checkboxes according to my selection. .

305
Mobile navigation click out jquery

Mobile navigation click out jquery

I have a function that when a user clicks outside of the mobile navigation close the mobile menu. I don't think I've got the code just right as when I click the mobile menu it opens and closes straight away.

428
Can&#39;t call event of element after element is appended

Can't call event of element after element is appended

I have a problem when using append() to add an element. After adding I want to handle the event keypress of this element but it won't work.

300