I initialize a UIWebView as follows:
NSString *msg = <HTML><BODY bgcolor=\"#504a4b\" style=\"font-family:Verdana; font-size:20\" > <B> No Messages";
[webviewMessageLog loadHTMLString:msg baseURL:NULL];
which shows the text exactly as I expect. Later, I want to append to this log. As a test, I did:
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *oldHTML = [webviewMessageLog stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
NSLog(@"%@", oldHTML);
this returns the HTML starting after the tag, like such:
<b> No Messages</b>
My question is: what javascript object do I need to read to see the parameters I set within the BODY tag? How would I see the font-family and bgcolor items that were previously set? I want to maintain whatever formatting had been set elsewhere, and I'm hoping to just read the prior BODY tag and avoid additional code to re-evaluate what the BODY tag should include.
Thanks!