开发者

how to detect javascript features on Android 1.5

开发者 https://www.devze.com 2022-12-27 01:54 出处:网络
I开发者_C百科\'m trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.

I开发者_C百科'm trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.

alert(localStorage); just hang on v1.5 while on v2.0.1 it alerts correctly.

is there an unblocking way to do it or to detect the version of Android with javascript?


I can get the Android version from navigator.userAgent though


Why not do something like this,

if(window.localStorage) {
    alert(localStorage);
}


I believe it is possible to overload the alert handler in a WebView. I would write my own based on an alert dialog and see if that works better than the default.

0

精彩评论

暂无评论...
验证码 换一张
取 消