I have a webView and when you open one view it takes the webView and gets the html (through javascript) and the problem is that when I try to load the edited html, it comes up funny looking, like it is missing the images and its mostly text and not as nice. For example: If I go on Yahoo Mobile and I change the Today Tab to say say lets say Hi, then it all comes out in one column as hyperlinks instead of with the big search bar, news in the middle etc.
Heres My Code For Retrieving The HTML:
-(IBAction)recieveHTML:(id)sender {
htmlView.hidden = NO;
NSString *html = [webView stringByEvaluatingJavaScriptFromString:
@"document.body.outerHTML"];
NSString *query = [html stringByReplacingOccurrencesOfString:@">" withString:@">\n"];
htmlTView.text = query;
universalURL = url.text;
}
Heres My Code For Reloading The HTML:
-(IBAction)changeHTML:(id)sender {
[htmlTView resignFirstResponder];
NSString *query = [htmlTView.text stringByReplacingOccurrencesOfString:@">\n" withString:@">"];
[self.webView loadHTMLString:query baseURL:[NSURL URLWithString:universalURL]];
htmlView.hidden = YES;
}
Does anyone know why this is happening?