Software Archive
Read-only legacy content
17061 Discussions

Incompatibily between Jquery and recent versions of Cordova ?

Michel_K_
Beginner
351 Views

Hello, dear XDK experts,

You did'nt get news from me since many months. Thanks to your advices I was able to publish my MVBD app in Google and Apple stores in september 2015. You helped me to find the cause of issues in the Windows environnement : Microsoft Explorer doesn't handle 'local storage' instructions ; I found it's the same for Microsoft Edge. Last month, I restarted restructuring my app, after a long break. I already had taken into account XDK evolution (plugins management, in particular) ; I recently upgraded software tools to XDK 3491 and Cordova CLI 6.2.0.

Several functions aren't not working any longer :

- the emulator and now the simulator do not dectect tapping ;

- in the debug mode,  using a connected  Androïd tablet, some Jquery listviews are incorrectly displayed ; I can remember that this issue did'nt appear in the built app ;

- the main current  issue shown in that debugging environnement is related to a $.getJSON(ad, function(documents){...} instruction, that was previously very well working. Data are still correctly retrieved but I get the following error message : Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. Display is very bad, several pages being mixed, and the app is reinitialized.

After having read some information on related subjects, I added the instruction $.ajaxSetup({ async: false });  before $.getJSON.  I updated the Jquery library (V 1.11.1) to version 2 then to version 3 and Jquery mobile to 1.4.5. No change in the app behaviour could be seen.

Do you confirm an incompatibility between Jquery and Cordova that could explain this issue ? Can you suggest solutions ? 

0 Kudos
2 Replies
PaulF_IntelCorp
Employee
351 Views

I'm not aware of any specific issues like those you describe, regarding jQuery and jQuery Mobile. We have found that jQuery 2.x works much better than jQuery 1.x in a webview environment (the environment your app runs in on the device), but have not heard any feedback regarding jQuery 3 (we do not test compatibility of third-party libraries against the various platforms, that is outside the scope of the XDK).

Keep in mind that many of the behaviors you encounter are due more to the webview on the target device than they are to Cordova. Although, in the case of AJAX calls, the Cordova framework can get in between you and the webview, for example, with respect to whitelists. Ultimately, you need to confirm your app runs on a real device, the XDK does not control how your app will behave on a real device, it simply provides a convenient debugging and packaging mechanism. The hardware and OS vendors (i.e., Google, Apple, Microsoft, and the hardware vendors) control how the embedded HTML5 webview behaves, the engine that runs your app once it is loaded on a device.

Regarding testing for proper behavior with jQuery, etc. I advise that you try in a fully-built app to confirm if this is something about the Debug module (Debug tab) or something in the webview. Keep in mind that when using the Debug tab on Android you are running in a Crosswalk webview, not the native webview. So your built app will only have similar behavior if you also build with Crosswalk. See this doc page for information on how to debug a built Android app > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#RemoteChromeDevTools <

I don't know where this error "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience" message is coming from, but my first guess would be the jQuery library and my second guess would be the webview itself is generating that message. Again, this is not something the XDK controls, it is outside of our domain.

Regarding tapping and the Simulator, that issue is being looked into, it appears to be a deficiency in that open-source project.

0 Kudos
Jamal_A_
Beginner
351 Views

jQuery 3.0 is not compatible with jQuery Mobile yet. If you do, the UI will be messed up.

It is better for now to use jQuery 2.2.4 with jQuery Mobile 1.4.5 until there is an update.

 

0 Kudos
Reply