我可以从 uiwebview 内的 iframe 访问本地图像吗?
基本上我尝试采用远程托管的 php / jquery / css / html Web 应用程序,并使用 big5 框架将其嵌入到 Objective C 中 uiwebview 内的 iframe 中。我已经设置了 iframe 并且网络应用程序可以正确进入。我现在的问题是我需要提高加载和性能。我认为最简单的方法是将所有图像托管在本地。我读过,我可以更改 baseURL,以便我可以访问本地文件系统图像,但我没有发现任何表明这可以通过 iframe 和远程文件(仅本地 html 文件)实现的内容。有什么办法可以做到这一点吗?我发现其他建议在加载时注入 javascript?我需要做什么,加载页面,等待它完成加载,将图像的相对路径注入到我的CSS文件中?这行得通吗?有更简单的解决方案吗?还是我绝望了?哈哈。谢谢
Basically Im attempting to take a php / jquery / css / html web app that is hosted remotely, and embed it in an iframe inside of a uiwebview in objective c using the big5 framework. I have my iframe set up and the web app is coming in correctly. My issue now is that I need to improve loading and performance. The easiest way to do this I think is to host all of the images locally. I've read that I can change the baseURL so that I can access local file system images, but I havent found anything suggesting that this is possible with an iframe and remote files, only local html files. Is there any way to do this? I found something else suggesting javascript injection on load? What would I have to do , load the page, wait for it to finish loading, inject into my css files the relative path to the images? will this work? is there an easier solution? or am I hopeless? haha. thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将图像存储为 base64 编码数据,并通过
data:
URI 方案。You could store the images as base64-encoded data, and load them via the
data:
URI scheme.