3

I have an issue with a UIWebView in my iPad app. When I try to load certain pages, it displays these cryptic error messages. Here's the result from http://allhiphop.com/stories/news/archive/2009/04/02/21315001.aspx

This page contains the following errors:

error on line 45 at column 8: Opening and ending tag mismatch: meta line 0 and head

Below is a rendering of the page up to the first error.

...(blah blah blah)

I'm sure the people at AllHipHop have committed some serious syntactical crimes, but the part that confuses me is that these pages display just fine in Safari (on the iPad). Any idea what's going on here? Something like webView.allowWhining=NO?

Neal Ehardt
  • 10,334
  • 9
  • 41
  • 51

2 Answers2

1

It turned out that AllHipHop was handling my app's requests differently than Safari's. UIWebView has a different user agent than iPad Safari. Go figure!

Setting the user agent solved my problem. Change User Agent in UIWebView (iPhone SDK) What is the iPad user agent?

Community
  • 1
  • 1
Neal Ehardt
  • 10,334
  • 9
  • 41
  • 51
0

This seems to be a repeat of this question

Basically you need to specify the MIME type to be "text/HTML" when you load the content in your UIWebView.

Community
  • 1
  • 1
jonkroll
  • 15,682
  • 4
  • 50
  • 43