相关疑难解决方法(0)

如何将元标记作为<head>部分中的第一个?

我正在使用JSF2,GlassFish 3.1,PrimeFaces 2.x.

我在IE9上遇到奇怪的渲染问题.我应该能够通过插入以下内容强制IE9呈现为IE9:

<html>
<head>
  <!-- Enable IE9 Standards mode -->
  <meta http-equiv="X-UA-Compatible" content="IE=9" />
...
Run Code Online (Sandbox Code Playgroud)

但事实是,它不起作用,因为(我被告知)元标记必须是该部分中的第一个标记.

当我在我的XHTML文件中执行此操作时...

<html ...>

<f:view contentType="text/html" locale="#{loginHandler.currentLocale}">

<h:head>
    <!-- Enable IE9 Standards mode -->
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
Run Code Online (Sandbox Code Playgroud)

生成的HTML看起来像这样,其中JSF/PrimeFaces在我的新元标记之前插入了一堆"链接"和"脚本"标记.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="/orcf-webui/javax.faces.resource/jquery/ui/jquery-ui.css.jsf?ln=primefaces&amp;v=2.2" />
<link type="text/css" rel="stylesheet" href="/orcf-webui/javax.faces.resource/wijmo/wijmo.css.jsf?ln=primefaces&amp;v=2.2" />
<script type="text/javascript" src="/orcf-webui/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&amp;v=2.2"></script>
<script type="text/javascript" src="/orcf-webui/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=primefaces&amp;v=2.2"></script>
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=9" />
Run Code Online (Sandbox Code Playgroud)

有没有办法让我的元标记在正确的位置,以便它可以工作?(或者让IE9问题消失的另一种方法是什么?

jsf primefaces internet-explorer-9

20
推荐指数
3
解决办法
3万
查看次数

标签 统计

internet-explorer-9 ×1

jsf ×1

primefaces ×1