UIWebView Xhmtl解析错误,但野生动物园不 [英] UIWebView Xhmtl parse error but safari don't
问题描述
我有一个显示标准html页面的应用程序.我将UIWebView用于html.当使用野生动物园的网页没有问题.当我使用uiwebview时,页面无法加载.
I have an application showing standard html pages. I use UIWebView for html. When using safari for pages no problem. When I use uiwebview the page does not load.
错误消息(UIWebView)
Error message(UIWebView)
This page contains the following errors:
error on line 230 at column 33: AttValue: " or ' expected
下面是直到第一个错误的页面渲染
Below is rendering of the page up to the first error
不同的页面出现不同的xhtml错误.
Different page different xhtml error.
我也实现了ipad模拟器加载页面的正确设置.
I realased that ipad simulator load page properly too.
推荐答案
我遇到了类似的问题. 我通过将页面的MIME类型显式设置为"text/html"来解决此问题. 否则,它将在UIWebview中被解析为xhtml.
I had a similar issue. I resolved it by explicitly setting the MIME type of the page to be "text/html". Otherwise it was being parsed in the UIWebview as xhtml.
例如在您的母版页集的ASP.NET中
eg in ASP.NET in your masterpage set
<% Response.ContentType = "text/html"; %>
还要检查您的<!DOCTYPE>
是否不是自称为xhtml.
Also check your <!DOCTYPE>
isn't claiming to be xhtml.
这篇关于UIWebView Xhmtl解析错误,但野生动物园不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!