将html附加到webview内容 [英] Append html to webview content
本文介绍了将html附加到webview内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前正在将网址(如Google.com)加载到我的网络视图中
currently loading a URL like Google.com into my web view like so
[webView setMainFrameURL:@"http://google.com"];
如何将html附加到< h1>页< / h1>
?
感谢
How can I append html to that like "<h1>End of page</h1>
"?
Thanks
推荐答案
您需要在页面加载到DOM文档对象模型之后操作DOM code> WebView 。您可以使用 WebFrameLoadDelegate
方法来确定网页何时成功加载。
You would need to manipulate the DOM (Document Object Model) after the page has loaded in the WebView
. You can use the WebFrameLoadDelegate
methods to determine when the page has loaded successfully.
要操作DOM,您可以通过各种DOM操作类使用Objective-C ,或者您可以使用JavaScript。
To manipulate the DOM, you can use Objective-C via the various DOM manipulation classes or you can use JavaScript.
这篇关于将html附加到webview内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文