phonegapをビルドしてAndroidの電話機でテストするときに問題があります。javascriptが実行されません。Phonegap - Javascriptが動作しない
私は、単純なconfig.xmlファイルを持っている、と私のindex.htmlの頭のプレビューがあります:
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>My app</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" src = "phonegap.js" > </script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1, user-scalable=yes">
<link href='https://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="Mobile_style.css"><link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<link href='https://fonts.googleapis.com/css?family=Quicksand:700' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" src = "phonegap.js" > </script>
<script type="text/javascript" charset="utf-8">
function onBodyLoad()
{
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady()
{
// do your thing!
}
</script>
<script type="text/javascript">
window.onload = function()
{
MY JS CODE
}
</script>
</head>
<body onload="onBodyLoad()">
MY HTML
</body>
私は2つのHTMLファイル、index.htmlをとgame.htmlを持って、私が持っていますゲームの頭の中で同じリンクやスクリプト。
私は自分のコードを入れようとしましたが、動作していません。
私は数時間の検索をしましたが、問題を解決できます。
ありがとうございました!
あなたは 'cordova.js'と' phonegap.js'宣言を2回繰り返しています。最後の2を削除し、残りの1つを削除します。あなたのページに宣言されているjQueryのバージョンは1つだけで、それに合わせてjQueryUIを追加することもできます。 –
ありがとう、私はどこに私のjsコードを置く必要がありますか? – Sanalol