在浏览器中显示的图像,但不在手机上
问题描述:
我正在使用IONIC作为我的移动应用程序。我的所有图像都显示在浏览器中,但不在手机上。代码,<img src="/img/exploratory.jpg" style="height:40px;">
有谁知道背后的原因?在浏览器中显示的图像,但不在手机上
答
你需要,因为如果你使用/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
当您使用远程调试时,您是否看到错误?它应该没有帮助,但从/ img/etc切换到img/etc有帮助吗?你在使用白名单插件吗? –
您确定不是:
? –
Gajotres
它与'img/exploratory.jpg'一起使用。 Thanku .. – Priyanka