Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

evalJS not working with Android but is fine in iPhone

$
0
0

using Android version 4.4 with Titanium 3.2.0 GA.

This code returns null on Android but works fine in iPhone.

var currentResolution = webView.evalJS('$("#txtResolution").val();');
currentResolution is null under android but not iPhone.

So the expression doesn't return a value. If instead of assigning the value, I simply put it inside an alert within the jQuery script, the value gets displayed in an alert and is not null. as bellow:

webView.evalJS('alert($("#txtResolution").val())');
The alert value is correct. Any ideas how to get the value and assign it to a variable? The webpage is also external.

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>