2015-09-04 124 views
0

我正在使用IONIC作爲我的移動應用程序。我的所有圖像都顯示在瀏覽器中,但不在手機上。代碼,<img src="/img/exploratory.jpg" style="height:40px;"> 有誰知道背後的原因?在瀏覽器中顯示的圖像,但不在手機上

+0

當您使用遠程調試時,您是否看到錯誤?它應該沒有幫助,但從/ img/etc切換到img/etc有幫助嗎?你在使用白名單插件嗎? –

+0

您確定不是:? – Gajotres

+0

它與'img/exploratory.jpg'一起使用。 Thanku .. – Priyanka

回答

2

你需要,因爲如果你使用/img,就成了brwoser localhost:port/img使用它作爲

<img src="img/exploratory.jpg" style="height:40px;"> 

,但在移動變得file:///img/這ofcourse是不正確的path.And當您只使用img/exploratory.jpg然後在移動它變成file:///android_asset/www/img/explatory.jog並且這是所有www數據在構建時打包的路徑。

+0

感謝您的描述性答案。 – Priyanka

相關問題