強制設置IE瀏覽器的版本模式


轉載自:http://blog.csdn.net/huwenhu2007/article/details/17954119

 

1.<meta http-equiv="X-UA-Compatible" content="IE=7" /> 通過在頁面head標簽中添加該屬性來進行設置;

2.對於頁面中引入了公共JSP頁面的需要在公共JSP頁面中也進行設置:

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
     <!-- 加上html標簽和meta -->
     <meta http-equiv="X-UA-Compatible" content="IE=7" /> 
</head> 
<c:set var="ctxPath" value="${pageContext.request.contextPath}" />
<!-- 正式環境IP:10.109.81.6  測試環境IP:10.103.117.11 -->
<c:set var="cognosPath" value="http://10.103.117.11/cognos10/cgi-bin/cognos.cgi" />
</html>


<script type="text/javascript">
var path = "${ctxPath}";
var cognosPath = "${cognosPath}";
</script>

3.對於iframe或者frame加載的頁面也需要進行單獨設置:

<head>
     <!-- 加上html標簽和meta -->
     <meta http-equiv="X-UA-Compatible" content="IE=7" /> 
</head> 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM