0
我试图在webview中使用此JavaScript打印HTML,但它实际上是打印<p>HELLO</p>
。我该如何解决这个问题?在代码中使用JavaScript在webview中设置HTML内容。
NSString* statement = [NSString stringWithFormat:@"document.getElementById('test').innerText = '<p>HELLO</p>'"];
[self.myWebView stringByEvaluatingJavaScriptFromString:statement];
http://stackoverflow.com/questions/992348/reading-html-content-from-a-uiwebview只是检查它是否有帮助 – hacker