IE9 only _sometimes_ ignores <base href>

佐手、 提交于 2019-12-03 09:08:46

We found it: Internet Explorer does all sorts of funny things when the HTML file returned from the server contains a UTF-8 BOM. We still consider this a IE bug but at least we found a work around.

Background info: During initial page generation some PHP files where included which are not included for successive requests (because most generated content is cached now and these files do not need to be run). Some of such included PHP files included a UTF-8 BOM. Because the BOM comes before the opening PHP tag, it is streamed out to the output of PHP.

We figured it out by comparing outputs in fiddler and the file sizes differed by 3, 6 or 9 bytes when the error occured. Running a diff over the outputs showed the BOM header, comparing in most Windows editors didn't show it because these editors know about a BOM. So the problem was hidden. Thank you IE for 2.5 days of useless work!

If you ever run into such a problem again, consider removing the base tag with config.baseURL > and render all links with an absolute URL:

Either use config.absRefPrefix = http://www.example.org/mysubfolder/ (most save variant) or use config.absRefPrefix = /.

i suspect you're not using an absolute path in the tag. IE is allowed to ignore your tag since its not specified correctly. See http://www.w3schools.com/tags/tag_base.asp

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