不同的域名访问同一站点显示不同LOGO
不同的域名访问同一站点显示不同LOGO
在此提供有两种方式
在此提供有两种方式
ASP
<%
if Request.ServerVariables("SERVER_NAME")="www.abc.com" then %>
<img src="1"></img>
<%else%>
<img src="2"></img>
<%
end if
%>
if Request.ServerVariables("SERVER_NAME")="www.abc.com" then %>
<img src="1"></img>
<%else%>
<img src="2"></img>
<%
end if
%>
HTML
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
</head>
<body>
<img id="logo" src="aa.gif" alt="aa"/>
<script type="text/javascript">
var img = {
"bbs.blueidea.com": "http://bbs.blueidea.com/images/default/logo.gif",
"163.com": "http://bbs.blueidea.com/images/default/announcement.gif",
"localhost": "http://www.baidu.com/img/logo-yy.gif"
}
if (img[document.domain]) {document.getElementById("logo").src = img[document.domain]; }
</script>
</body>
</html>