关于客户网站IE兼容问题的解决方案

user

雨橙

中国.四川.成都

世界之上、唯有远见、惟爱不变。


今天客户反映我之前给他们做的网站出了点问题。问题在于头部多国语言选择这里在IE环境下面无法跳转。

给大家看下网站如下图:




然后我自己在IE环境下做了测试。发现确实在IE下面点右上角头部语言选择栏的时候无法跳转页面。后面我看了所有页面代码。发现也没有什么问题。最后我把代码锁定在头部公共文件里面:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"> 
<head>
	<title><%=config(1)%></title>
	<meta http-equiv="Content-Type" content="text/html;charset=gb2312" /> 	
	<meta http-equiv="x-ua-compatible" content="IE=EmulateIE7" >
	<meta name="language" content="zh-CN" /> 	
	<meta name="robots" content="all"/>	
	<meta name="author" content="<%=config(2)%>,<%=config(1)%>" />	
	<meta name="Copyright" content="<%=config(2)%>,<%=config(1)%>" />	
	<meta name="keywords" content="<%=config(9)%>" />
	<meta name="description" content="<%=config(10)%>" />	
	<link type="text/css" media="all" rel="stylesheet" href="/css/reset.css" />
	<link type="text/css" media="all" rel="stylesheet" href="/css/default.css" />
</head>
<body>
<a name="top" id="top"></a> 


<script language="javascript" type="text/javascript" src="/js/jquery.min.js"></script>
<!--基础文件,分别是jQuery基库和拖拽UI插件-->
<script src="/js/jquery.ui.draggable.js" type="text/javascript"></script>

<!-- 对话框核心JS文件和对应的CSS文件-->
<script src="/js/jquery.alerts.js" type="text/javascript"></script>
<link href="/css/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
function hiddenmenus(obj)
{	
	if (event.toElement.tagName != "LI" && event.toElement.tagName != "INPUT" && event.toElement.tagName != "UL")	
	{
		obj.style.display = "none";
	}
	
}

function setLangstr(str){
	if (str)
	{
		document.getElementById("langs").value = str;
		document.getElementById("langpan").style.display="none";

		if (str == "中文简体")
		{
			window.location.href="default.asp?lang=Zh_cn";
		}
		else if (str == "EngLish")
		{
			window.location.href="default.asp?lang=English";
		}
		else if (str == "日本語")
		{
			window.location.href="default.asp?lang=Japanese";
		}
		else if (str == "Deutsch")
		{		
			//window.alert(str + " == " + "Deutsch");
			window.location.href="default.asp?lang=Germany";
		}
		
		
	}
}

function showlangmenu()
{
	var sty = document.getElementById("langpan").style.display;
	if (sty == 'none')
	{
		document.getElementById("langpan").style.display = "block";
	}
	else
	{
		document.getElementById("langpan").style.display = "none";
	}
}

function hiddenlangmenu()
{
	//document.getElementById("langpan").style.display="none";
}


function showRplinfo(obj,n1,num)
{
	if (obj&&n1&&num)
	{
		for (var i=1;i<=num;i++)
		{
			if (n1 == i)
			{
				document.getElementById('rpl_'+n1).style.display='block';
				obj.className='OVERmorenlicls';
			}
			else
			{
				document.getElementById('rpl_'+i).style.display='none';
				document.getElementById('inli_'+i).className='morenlicls';
			}			
		}
	}


}



function showRplinfo_n(obj,n1,num)
{
	if (obj&&n1&&num)
	{
		for (var i=1;i<=num;i++)
		{
			if (n1 == i)
			{
				document.getElementById('mct_'+n1).style.display='block';
				obj.className='Overckpitems';
				document.getElementById("currenttab").innerText = obj.innerText; 
			}
			else
			{
				document.getElementById('mct_'+i).style.display='none';
				document.getElementById('cnp_'+i).className='ckpitems';
			}			
		}
	}


}

</script>






	<!-- header -->
	<div class="header">
		<div class="headerMain">
			<div class="headerLogo">
				<a href="/index.asp"><img src="/images/ewm_08.png"/></a>
			</div>
			<div class="headerMenuline">
				<div class="yylines">
<!--#include file="topsearch.asp" -->
<!--#include file="selectLang.asp" -->
				</div>
				<div class="menulines">
					<a href="/product"><%Call getLang(LangQuery,"headNavcpzx")%></a><img src='/images/xr_13.png'/>
					<a href="/jjfa.asp?id=1"><%Call getLang(LangQuery,"headNavjsyj")%></a><img src='/images/xr_13.png'/>
					<a href="/fwzc.asp?id=1"><%Call getLang(LangQuery,"headNavfwzc")%></a><img src='/images/xr_13.png'/>
					<a href="/zxxx.asp?id=1"><%Call getLang(LangQuery,"headNavzxxx")%></a><img src='/images/xr_13.png'/>
					<a href="/aboutus.asp?id=111"><%Call getLang(LangQuery,"headNavgywm")%></a><img src='/images/xr_13.png'/>
					<a href="/lxwm.asp?id=1"><%Call getLang(LangQuery,"headNavlxwm")%></a>
				</div>
			</div>
		</div>
	</div>
	<!-- header end -->


最后确定到这一行代码:

<meta http-equiv="x-ua-compatible" content="IE=7" >


正是由于这一行的原因导致了JS,window.location.href无法跳转。去掉这句代码就可以了。


注:本文内容均系原创。如需转载分享请标明出处。
posted at