在IE9中以兼容模式打开Intranet jsf应用程序 [英] intranet jsf application opening in compatibility mode in IE9
问题描述
我在jsf,primefaces制作了一个内联网网站。因为IE 9默认它在兼容性视图中打开。
i知道我应该使用标签
i have made a intranet website in jsf, primefaces. becuase of IE 9 defaults it opens in compatability view. i know i am supposed to use the tag
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
但它不起作用而是显示
HTML1115:X-UA兼容的META标记('IE = edge')被忽略,因为
文档模式已经完成。
HTML1115: X-UA-Compatible META tag ('IE=edge') ignored because document mode is already finalized.
我已经使用了这个标签
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Wan</title>
</h:head>
这是开发人员工具中显示的内容
this is what it shows in the developers tools
<head>
<TITLE>Wan</TITLE><LINK rel=stylesheet type=text/css href="/Wan/javax.faces.resource/theme.css.jsf?ln=primefaces-redmond"><LINK rel=stylesheet type=text/css href="/Wan/javax.faces.resource/primefaces.css.jsf?ln=primefaces&v=5.1">
<SCRIPT type=text/javascript src="/Wan/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=5.1"></SCRIPT>
<SCRIPT type=text/javascript src="/Wan/javax.faces.resource/primefaces.js.jsf?ln=primefaces&v=5.1"></SCRIPT>
<SCRIPT type=text/javascript src="/Wan/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces&v=5.1"></SCRIPT>
<LINK rel=stylesheet type=text/css href="/Wan/javax.faces.resource/charts/charts.css.jsf?ln=primefaces&v=5.1">
<SCRIPT type=text/javascript src="/Wan/javax.faces.resource/charts/charts.js.jsf?ln=primefaces&v=5.1"></SCRIPT>
<STYLE id=ex_canvas_>canvas {
TEXT-ALIGN: left; WIDTH: 300px; DISPLAY: inline-block; HEIGHT: 150px; OVERFLOW: hidden
}
</STYLE>
<LINK rel=stylesheet type=text/css href="/Wan/javax.faces.resource/wanstyle.css.jsf?ln=css">
<META content=IE=edge http-equiv=X-UA-Compatible>
我猜这种情况正在发生,因为元标记必须包含的很多其他帖子中都有提及头顶但我不知道如何实现这一点。
i am guessing this is happening beacuse as mentioned in alot of other posts the meta tag has to be at the top of the head but i dont know how i could achive this.
如何让我的元标记成为我应用程序中的第一个标记
这完全是IE中的控制台显示的内容
this is completely what the console in IE is showing
HTML1202: http://10.164.210.37:8080/Wan/welcome.jsf is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked.
welcome.jsf
HTML1115: X-UA-Compatible META tag ('IE=edge') ignored because document mode is already finalized.
welcome.jsf
S15: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
推荐答案
在jsf PrimeFaces中你必须使用以下内容重新排序标签
In jsf PrimeFaces you have to use the following to reorder the tags
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</f:facet>
它使用该代码将元数据移动到生成的标题的顶部并且有效
It moved the meta to the top of the generated header using that code and it worked
来自以下 link
这篇关于在IE9中以兼容模式打开Intranet jsf应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!