2
剛安裝了最新版本的phonegap &使用npm install在Windows7上漣漪。Ripple + Phonegap - deviceready not firing
我運行我的項目目錄中的漣漪效果以在Chrome中啓動漣漪效果。
http://localhost:4400/?enableripple=cordova-3.0.0
但是我收到一個文件沒有在cordova.js上找到,我的deviceready事件沒有被觸發。
GET http://localhost:4400/cordova.js 404 (Not Found)
項目運行jquery mobile 1.4.4與jquery 1.11.1。
這就是我的js在我的頁腳中看起來像的樣子。我該如何解決這個問題並讓我的deviceready事件觸發?
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="css/vendor/jquery-mobile/jquery.mobile-1.4.4.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
測試設備準備好以下js。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// Now safe to use the Cordova API
console.log("Device Ready");
}
嘗試僅在'index.html'中調用'deviceready'事件偵聽器。這個竅門對我有用。 – byJeevan 2014-10-31 11:06:03