0
我有一個img,正確顯示在主頁上,但是當我導航到其他頁面時,圖像不會顯示在我的手機上。在瀏覽器中,它按預期顯示圖像。我真的不知道是什麼問題...科爾多瓦 - jquery手機img路徑
這是JavaScript代碼,我追加的HTML表:
var imgPath = '../img/icons/notification_bell.png';
html = html + "<tr><td class='img-table'><img src=" + imgPath + "/></td>" + "<td><span class='time-aside'><strong>" + formattedTime + "</strong></span><h4>" + info.data[count][1] + "</h4><p>" + info.data[count][2] + "</p></td></tr>";
,這是HTML:
<div data-role="page" id="all">
<div data-role="header">
<a href="#dashboard" class="ui-btn ui-icon-carat-l ui-btn-icon-notext ui-alt-icon ui-corner-all ui-btn-left" data-transition="slide" data-direction="reverse">No text</a>
<h1>All Reminders</h1>
</div>
<div data-role="main" class="ui-content" data-theme="b">
<table data-role="table" data-mode="column" id="notificationTable" class="ui-responsive">
<tbody>
</tbody>
</table>
<a class="clearbtn" style="text-decoration: none"><button>clear</button></a>
</div>
</div>
當我檢查圖像與chrome://inspect/
我得到這個錯誤:
/img/icons/notification_bell.png/:1 GET file:///img/icons/notification_bell.png/ net::ERR_FILE_NOT_FOUND
當我將其設置手動爲t他相同的路徑上這樣的儀表盤:'img/icons/notification_bell.png'
它顯示了,但是當我通過JS做它不顯示...