只是試圖讓jquery移動電話發射,但我無法讓我的你好世界射擊。Phonegap與jQuery的移動「你好世界」不工作
所有對Js的引用都是正確的。
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="phonegap-1.1.0.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery_mobile.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
$(document).ready(function() {
$(document).bind("deviceready", function(){
navigator.notification.alert("hello world");
});
});
}
</script>
</head>
<body>
</body>
</html>
工作魅力,關心爲什麼要進入一個小細節? –
太棒了!文檔尚未準備好添加事件偵聽器,直到正文加載。 –
對不起,這是行不通的。我需要一些只會在jQuery,jquery mobile和document body加載後纔會觸發的東西。我測試瞭如果我刪除了jQuery手機腳本標籤會發生什麼情況,並且這仍然起作用。我還檢查了沒有觸發的'typeof(jQuery)',表明它不依賴於這些腳本,並且不會等待它們。 –