在phonegap的帮助下,我正在制作一个使用phonegap sqlite数据库的android应用程序,因为我将数据存储在数据库中并从数据库中取回以显示,但我的图像没有显示,只有图像的路径被存储。请帮我找出我的错误。
在 JQuery 中:-
function List() {
$.ajax({
type: "GET",
url: "one.html",
contentType: "text/xml",
dataType: "xml",
data: "",
crossDomain: true,
success: function(xml) {
$(xml).find('xyz').each(function() {
var title = $(this).find('title').text();
var Image = $(this).find('image').text();
db.transaction(function(transaction) {
transaction.executeSql('INSERT INTO A
VALUES ("' + title + '","' + Image + '")',
nullHandler, errorHandler);
});
});
Dynamic_List();
return false;
}
}
});
}
/*This Method Create Dynamic Menu Item List*/
function Dynamic_List() {
$('.mylistview').empty();
db.transaction(function(transaction) {
transaction.executeSql('SELECT * FROM A;', [],
function(transaction, results) {
if (results != null && results.rows != null) {
for (var i = 0; i < results.rows.length; i++) {
var image = results.rows.item(i).A_Image;
var Title = results.rows.item(i).A_Title;
$('.mylistview').append(
'<li class = "cat_list">' +
'<div class = "divli">' +
'<div class = "menuImg" ' +
'style = "height:48px; width:48px;">' +
menu_image +
'</div>' +
'<div class = "divbody">' +
'<h3>' + menu_Item_Title + '</h3>' +
'</div>' +
'</div>' +
'</li>');
}
}
}
}, errorHandler);
}, errorHandler, nullHandler);
return;
}
在 HTML5 中:-
<div class = "foodList">
<ul class = "mylistview"
style = "display: block;"
id = "my_dynamic_list_view">
</ul>
</div>