我注意到在JSF 2.1.*中,我的IE条件注释不再起作用. HTML实体&替换了各种字符.使注释语法无效. BalusC指出了另一个问题中的解决方案使用h:outputText.我的问题是,我希望在第一个元素周围的页面顶部显示条件注释.这意味着我不能使用h:outputText,因为我还没有定义它的命名空间.我相信这是正确的.这是一个代码示例.
I've noticed that in JSF 2.1.* my IE conditional comments are no longer working. Various characters are being replaced by HTML entities & invalidating the comment syntax. BalusC has pointed out a solution to the problem in another question which uses h:outputText. My problem is that I want my conditional comments at the top of my page, around the first element. This means that I can't use h:outputText as I haven't defined it's namespace yet. I believe that's correct anyway. Here's a code example.
当今大多数JSF页面将从类似于HTML5 Boilerplate语法的模板开始:
Most by JSF pages nowadays will start off with a template similar to the HTML5 Boilerplate syntax:
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 my-application" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8 my-application" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9 my-application" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js my-application" xmlns="www.w3/1999/xhtml" xmlns:ui="java.sun/jsf/facelets" xmlns:h="java.sun/jsf/html" xmlns:f="java.sun/jsf/core" xmlns:c="java.sun/jsp/jstl/core" lang="en"><!--<![endif]--> <h:head> <meta charset="utf-8" /> ...使用BalusC提到的解决方案,我希望在第2行上输入<h:outputText />,但尚未定义h名称空间.是我可以使用的元素,可以将各种名称空间附加到该元素,但不会影响最终的HTML吗?还有其他想法可以解决这个问题吗?
With BalusC's mentioned solution, I'd want <h:outputText /> on line 2 but the h namespace isn't defined yet. Is that an element I can use that I can attach the various namespaces to but won't affect my final HTML? Any other ideas how I can get round this issue?
李
推荐答案将其全部包装在<f:view>中,并在其中定义名称空间.
Wrap it all in a <f:view> and define the namespaces there.
<!DOCTYPE html> <f:view xmlns="www.w3/1999/xhtml" ...> ... </f:view>否则,整个JSF视图已经隐式包装在<f:view>中.
The entire JSF view is otherwise already implicitly wrapped in a <f:view>.
更多推荐
JSF 2.1及更高版本IE条件注释
发布评论