黑莓手机上的WebSql-phonegap



我是黑莓的新手。我使用phonegap创建跨平台应用程序。我正在使用phonegap在黑莓上尝试websql。我的html文件如下:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" charset="utf-8">
var db= openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
var msg;
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS COMPANY (id unique, log)');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (1, "Unisys")');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (2, "UGSI")');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (3, "TCIS")');
tx.executeSql('INSERT INTO COMPANY (id, log) VALUES (4, "mobcomp")');
msg = '<p>Log message created and row inserted.</p>';
document.querySelector('#status').innerHTML = msg;
});

db.transaction(function (tx) {
tx.executeSql('SELECT * FROM COMPANY', [], function (tx, results) {
var len = results.rows.length, i;
msg = "<p>Found rows: " + len + "</p>";
document.querySelector('#status').innerHTML += msg;
for (i = 0; i < len; i++){
msg = "<p><b>" + results.rows.item(i).log + "</b></p>";
document.querySelector('#status').innerHTML += msg;
}
}, null);
});
</script>
</head>
<body>
<div id="status" name="status">Status Message</div>
</body>
</html>

此代码与ANDROID配合良好。但在黑莓手机上,模拟器除了状态消息行外,什么都不显示。有人能在这个问题上帮我吗?

提前感谢,Akshatha

黑莓5.0不支持HTML5 WebSQL,而是使用Google Gears APIhttp://code.google.com/intl/es-ES/apis/gears/api_database.html

最新更新