UIWebView Xhmtl parse error but safari don't

[亡魂溺海] 提交于 2019-12-02 09:40:45

问题


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.

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

Different page different xhtml error.


I realased that ipad simulator load page properly too.


回答1:


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.

eg in ASP.NET in your masterpage set

<% Response.ContentType = "text/html"; %>

Also check your <!DOCTYPE> isn't claiming to be xhtml.



来源:https://stackoverflow.com/questions/3701598/uiwebview-xhmtl-parse-error-but-safari-dont

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!