我問你,因爲我卡在愚蠢的東西,我不能找出...的PhoneGap無法檢測index.js
我開始使用PhoneGap的前幾天,我還是挺進展好吧,但今天早上,我的index.html不再關心我的js/index.js了!
我有一個按鈕,應該發出警報,但當我單擊按鈕時,根本沒有任何反應。
我明白我必須搬錯了東西,但請你看看?
我試圖刪除儘可能多的無用信息。 這裏是我的HTML代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="jquery-1.7.2.js"></script>
<script src="jquery.mobile-1.1.0.js"></script>
<script src="jquery.url.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="phonegap.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile.structure-1.3.2.min.css" />
<link rel="stylesheet" href="themes/AndroidHoloDarkLight.min.css" />
</head>
<body>
<div data-role="page" data-theme="a">
<div data-role="header" data-position="inline">
<h1>My Test App</h1>
</div>
<input type="button" name="goBack" id="goBack" onclick="goBack" value="Go Back to the previous View">
</div>
</body>
</html>
這裏是.js文件:
function goBack()
{
alert("test ...");
}
/*$("#bodyPage").ready(function(){
$.mobile.allowCrossDomainPages = true;
$("#page").bind("pageshow", function(event){
var url = $.url(document.location);
var arg1 = url.param("arg1");
$("#testP").text(arg1);
});
}
我通過自己學習,所以我可能誤解的東西,但你可以請幫我啓發? 非常感謝您的時間。
您可以在同一個地方把你的index.js其中phonegap.js和jquery.js和現在和檢查一次。 –
你爲什麼每次兩次加載jquery和jquery mobile?順便說一句,應該是:'onclick =「goBack()」' –
是啊有這些問題,感謝您的注意,儘管它繼續保持同樣的方式= /表現就像沒有.js –