-1
爲什麼在iOS模擬器的jQuery Mobile圖像列表視圖中不顯示某些圖片?在jQuery圖像列表視圖中查看圖像
而不是圖像,它顯示一個帶有問號的藍色框。如果出現網址問題,那麼所有圖片肯定會顯示帶有問號的圖標,但有些圖片顯示完美無瑕。
我將圖像大小調整爲較小的大小,但沒有解決問題。我該如何解決這個問題?
這是從mysql數據庫獲取圖像的javascript。所有圖像都在後端根文件夾中。
.$(function() {
var serviceUrl = 'http://localhost/Backend/getDinner.php?jsoncallback=?';
var dataStore = {};
$.ajax({
url: serviceUrl,
crossDomain: true,
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
jsonpCallback:'jsoncallback',
})
.success(function(data) {
$.each(data, function(i, item){
// Stash the items by id for later retrieval.
dataStore[item.ID] = item;
var $row = $(
'<li>' +
'<a data-transition="slide" href="#detailsPage">' +
'<img src="' + item.ImageURL + ' ">' +
'<h2>' + item.Title + '</h2>' +
'<h2>' + 'Price :'+ item.Price + '</h2>' +
'</a>' + '</li>');
$('#output').append($row);
這裏是獲取列表視圖的HTML。
<div data-role="content" data-scroll="true" >
<ul id="output" data-role="listview" ></ul>
以下是IOS屏幕截圖。
一些代碼請。 – Omar 2013-04-04 12:44:46
你可以在這裏發佈Item.ImageURL的值嗎? – 2013-04-04 13:40:23
你的意思是「ImageURL」:「images \/dinner \ /breakfast5.jpg」, – 2013-04-04 13:46:28