How can I link in both remote and local assets into a webview?

Posted by Greg on Stack Overflow See other posts from Stack Overflow or by Greg
Published on 2010-06-01T14:51:08Z Indexed on 2010/06/01 15:53 UTC
Read the original article Hit count: 221

Filed under:
|

I'm loading HTML-formatted content into my app from a web service, then plugging that into a local HTML template that lives within the app. Now, I need to set the UIWebView's BaseURL to point at the remote server so that all relative image links will load. However, I'm also trying to link in some local assets (CSS, JavaScript). Thus far, I have not found any documentation on how to link in local assets without relying on the UIWebView's baseURL. I've tried injecting the absolute file path of my CSS and JS into my HTML template, but it hasn't worked... I don't know if that means that it doesn't work, or if I'm just doing it wrong.

Has anyone ever run into this scenario, and if so, how did you address it? Thanks in advance, I really appreciate any tips!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c