本地文件从Android上使用PhoneGap的外部URL innaccessible [英] Local files are innaccessible from an external url using PhoneGap on Android
本文介绍了本地文件从Android上使用PhoneGap的外部URL innaccessible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<img src="file:///android_asset/www/images/image.png" style="border: black dashed 2px"/>
这行code ++工程按预期在本地的HTML文件。
This line of code works as expected on a local html file.
但是,当你打开应用程序内的外部URL。 (例如 http://www.example.com/mobile/ )同一行$ C的$ C不显示图像。
However when you open an external url inside the app. (For example http://www.example.com/mobile/) The same line of code doesn't show an image.
需要明确的是,我试图从外部URL访问本地文件,因为有一些JS文件是巨大的,这将是浪费带宽从外部下载。
To be clear, I am trying to access local files from an external url, because there are some JS files that are huge and It will be a waste of bandwidth to download them externally.
推荐答案
远程站点将永远无法从文件加载图像://协议。
The remote site will never be able to load an image from the file:// protocol.
这篇关于本地文件从Android上使用PhoneGap的外部URL innaccessible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文