I am using the following html code at the startup of my Android wallpaper app to branch off to different home screens based on the screen size. When I try it on my large screen Android device, it stays on the same page (it freezes on this page’s blue background) and doesn’t redirect. Can you look it over and see what might be wrong?
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no" name="viewport">
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if (screen.width > 640) {
window.location = "ipad/index.html";
}
else {
window.location = "iphone/index.html";
}
}
</script>
<style type="text/css">
body { background-color: blue; }
</style>
</head>
<body>
</body>
</html>