最終日に私はJavascript、HTML、CSSでPhonegapでアプリケーションを実現しようとしましたが、問題があります...アプリケーションをGoogleから実行するとアプリケーションが起動しますクロム、しかし、別のブラウザやアンドロイドを介してそれはしません。私はそれを解決しようとしましたが、私にとってはすべてが大丈夫です。私を助けてくれますか?Phonegapプロジェクト:データベースはクロムでのみ実行されます
FIRST PAGE
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<link rel="stylesheet" type="text/css" href="css/base.css" />
<title>Viaggio Ideale</title>
\t
\t <script type="text/javascript" charset="utf-8" src="js/SQLitePlugin.js"></script>
\t <script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
\t
function onDeviceReady(){
\t var db = window.openDatabase("ViaggioIdeale_DB", "1.0", "ViaggioIdeale", 200000);
db.transaction(populateDB, errorCB);
}
function populateDB(tx) {
\t tx.executeSql('DROP TABLE IF EXISTS USA');
\t tx.executeSql('CREATE TABLE IF NOT EXISTS USA (id INTEGER PRIMARY KEY AUTOINCREMENT, Nome TEXT NOT NULL, Clima TEXT NOT NULL, Interesse TEXT NOT NULL, Tipologia TEXT NOT NULL)');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Alabama", "Mite", "Sport", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Alabama", "Mite", "Musica", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Alabama", "Mite", "Carnevale", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Alabama", "Mite", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Alaska", "Rigido", "Ghiacciai", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Alaska", "Rigido", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Arizona", "Arido", "Deserti", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Arizona", "Arido", "Canyon", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Arizona", "Arido", "Natura Estrema", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Arkansas", "Mite", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Arkansas", "Mite", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Arkansas", "Mite", "Fiumi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Grattacieli", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Spiagge", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Parchi Divertimento", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Cucina", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Deserti", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Casinò", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Cinema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("California", "Vario", "Night Life", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Colorado", "Arido", "Natura Estrema", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Colorado", "Arido", "Canyon", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Colorado", "Arido", "Cucina", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Colorado", "Arido", "Deserti", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Connecticut", "Vario", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Delaware", "Mite", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Delaware", "Mite", "Natura", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Delaware", "Mite", "Estate", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Delaware", "Mite", "Festival", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Florida", "Vario", "Spiagge", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Florida", "Vario", "Grattacieli", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Florida", "Vario", "Parchi Divertimento", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Florida", "Vario", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Florida", "Vario", "Night Life", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Georgia", "Arido", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Spiagge", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Spiagge", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Natura Estrema", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Spiagge", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Hawaii", "Tropicale", "Mare", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Idaho", "Vario", "Natura Estrema", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Idaho", "Vario", "Parchi Divertimento", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Grattacieli", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Cucina", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Laghi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Fiumi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Night Life", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Illinois", "Continentale", "Parchi Divertimento", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Indiana", "Vario", "Grattacieli", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Indiana", "Vario", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Indiana", "Vario", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Indiana", "Vario", "Laghi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Iowa", "Continentale", "Cucina", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Iowa", "Continentale", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Kansas", "Vario", "Grattacieli", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Kansas", "Vario", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Kansas", "Vario", "Fiumi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Kansas", "Vario", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Kentucky", "Mite", "Cucina", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Louisiana", "Sub-Tropicale", "Cucina", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Louisiana", "Sub-Tropicale", "Carnevale", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Louisiana", "Sub-Tropicale", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Louisiana", "Sub-Tropicale", "Night Life", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Maine", "Vario", "Natura", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Maryland", "Sub-Tropicale", "Cucina", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Maryland", "Sub-Tropicale", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Massachusetts", "Vario", "Grattacieli", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Massachusetts", "Vario", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Massachusetts", "Vario", "Natura", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Massachusetts", "Vario", "Night Life", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Michigan", "Continentale", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Michigan", "Continentale", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Michigan", "Continentale", "Grattacieli", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Michigan", "Continentale", "Laghi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Minnesota", "Continentale", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Minnesota", "Continentale", "Laghi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Minnesota", "Continentale", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Mississipi", "Sub-Tropicale", "Fiumi", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Mississipi", "Sub-Tropicale", "Natura", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Missouri", "Continentale", "Fiumi", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Missouri", "Continentale", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Missouri", "Continentale", "Grattacieli", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Montana", "Vario", "Natura Estrema", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nebraska", "Vario", "Natura", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nebraska", "Vario", "Musei", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nevada", "Arido", "Deserti", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nevada", "Arido", "Natura Estrema", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nevada", "Arido", "Casinò", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nevada", "Arido", "Grattacieli", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nevada", "Arido", "Night Life", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("Nevada", "Arido", "UFO", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Hampshire", "Vario", "Natura", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Mexico", "Arido", "Deserti", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Mexico", "Arido", "Natura Estrema", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Mexico", "Arido", "Cucina", "Montagna")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Laghi", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Grattacieli", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Fiumi", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Night Life", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Cucina", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Casinò", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Musei", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New York", "Continentale", "Natura", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Jersey", "Vario", "Grattacieli", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Jersey", "Vario", "Casinò", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Jersey", "Vario", "Night Life", "Mare")');
tx.executeSql('INSERT INTO USA(Nome,Clima,Interesse,Tipologia) VALUES ("New Jersey", "Vario", "Parchi Divertimento", "Mare")');
}
function errorCB(err) {
alert("Siamo spiacenti, c'è stato un errore di caricamento: "+err.code);
}
</script>
</head>
<body><center><img style="margin-top:13%;" width="80%" src="img/logo.png">
<br><br><br>
\t \t <a href="mare.html"><button id="start" >Trova la tua nazione!</button></a><br><br>
\t \t <a href="https://www.facebook.com/rizieri.mele"><button id="credits">Developer</button></a><br><br>
\t \t <font size="1" color="white">Copyright Rizieri Mele - 2016</font>
\t \t </center>
</body>
</html>
他のページがありますが、私は(アップロードされた最後のページでは、スクリプトが動作しない)だけで、他2を追加します。
2ページ目
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<link rel="stylesheet" type="text/css" href="css/base.css" />
<title>Mare</title>
\t
\t <script type="text/javascript" charset="utf-8" src="js/SQLitePlugin.js"></script>
\t <script type="text/javascript" src="js/cordova.js"></script>
<script type="text/javascript" charset="utf-8">
\t
\t function salva(){
var ris = document.getElementById("marmon");
\t \t \t \t var tris = ris.options[ris.selectedIndex].text;
\t \t \t \t localStorage.setItem("tipo",tris);
\t \t \t \t
}
</script>
</head>
<body>
<center>
\t \t <div id="question"><h1><font face="Arial">Preferisci il Mare o la Montagna?</font></h1>
\t \t <select id="marmon">
<option>Mare</option>
<option>Montagna</option>
</select><br><br><br>
\t \t </div><br><br>
<a href="clima.html"><button onClick="salva()">Vai Avanti</button></a><br><br>
\t \t <font size="1" color="white">Copyright Rizieri Mele - 2016</font>
\t \t </center>
</body>
</html>
3ページ目
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<link rel="stylesheet" type="text/css" href="css/base.css" />
<title>Clima</title>
\t
\t <script type="text/javascript" charset="utf-8" src="js/SQLitePlugin.js"></script>
\t <script type="text/javascript" src="js/cordova.js"></script>
<script type="text/javascript" charset="utf-8">
\t document.addEventListener("deviceready", onDeviceReady, false);
\t
function onDeviceReady(){
\t var db = window.openDatabase("ViaggioIdeale_DB", "1.0", "ViaggioIdeale", 200000);
db.transaction(queryDB);
}
function errorCB(err) {
alert("Error processing SQL: "+err.code);
}
\t
\t function queryDB(tx){
\t var tipo = localStorage.getItem("tipo");
tx.executeSql('SELECT DISTINCT Clima FROM USA WHERE Tipologia = "'+tipo+'"',[],querySuccess,errorCB);
}
\t \t
\t \t
function querySuccess(tx,result){
var len = result.rows.length;
for(var i=0; i<len; i++) {
var riga = result.rows.item(i);
\t \t \t \t document.getElementById('clima').innerHTML += '<option>'+riga["Clima"]+'</option>';
\t \t }
\t \t }
\t \t
\t function salva(){
var ris = document.getElementById("clima");
\t \t \t \t var tris = ris.options[ris.selectedIndex].text;
\t \t \t \t localStorage.setItem("clima",tris); \t \t
}
</script>
</head>
<body>
<center>
\t \t <div id="question"><h1><font face="Arial">Quale tipologia di clima preferisci?</font></h1>
\t \t <select id="clima">
</select>
<br><br><br>
</div>
<br><br>
\t \t
<a href="firstinteresse.html"><button onClick="salva()">Vai Avanti</a></button><br><br>
\t \t <font size="1" color="white">Copyright Rizieri Mele - 2016</font>
\t \t </center>
</body>
</html>
不条理は、スクリプトがGoogle Chromeで動作することです。私はデータブラウザを削除しようとしましたが、これらは可能だと思っていますが、何も考えていません。
PS:アプリケーションを起動するたびにデータベースが削除されて再作成されますが、一時的なものなので、アプリケーションを起動したかどうかを制御する「IF」を追加します。
ありがとうございました!
ありがとうございます。私はappをテストするためにchromeを使います(そしてデータベースは動いています)...しかし、Phonegap Buildサービスを使ってビルドした後に... 3ページ目に "Error processing query:Undefined"というエラーが表示されます。 – rizieri