JSF2.1.7 renders <!--[if IE ]> tag as text

荒凉一梦 提交于 2019-12-23 16:08:40

问题


We upgraded our JSF to latest version 2.1. previously we were in JSF2.0.4. Our xhtml pages has Targeting IE Using Conditional Comments tag,which were not rendered as text.

But with new JSF2.1.7 this is being rendered as text in IE . Any ideas how to get around this issue?


回答1:


Use <h:outputText escape="false"> instead.

<h:outputText value="&lt;!--[if IE]&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie.css&quot;/&gt;&lt;![endif]--&gt;" escape="false" />



回答2:


You can do something like this:

<f:verbatim>
  <!--[if lte IE 8]>
    <script src="js/conditional-comment.js"></script>
  <![endif]-->
</f:verbatim>


来源:https://stackoverflow.com/questions/10195310/jsf2-1-7-renders-if-ie-tag-as-text

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