deviceready处理程序没有被称为ios phonegap 3.3.3 [英] deviceready handler not being called ios phonegap 3.3.3

查看:60
本文介绍了deviceready处理程序没有被称为ios phonegap 3.3.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

index.html

index.html

<script>
   function onDeviceReady() {
       alert("onDeviceReady");
       var options = {frequency: 500};
       watchId = navigator.accelerometer.watchAcceleration(onSuccess, onFailure, options);
    }
    document.addEventListener("deviceready", onDeviceReady, false);
</script>

没有调用Phonegap 3.3.3设备就绪处理程序。

Phonegap 3.3.3 device ready handler is not being called.

推荐答案

从脚本中删除app.initialize()(这会弄乱事件处理程序)

remove app.initialize() from the script (that messes up the event handler)

这篇关于deviceready处理程序没有被称为ios phonegap 3.3.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆