下面是2个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=utf-8" />
<title>Commision </title>
<script type="text/javascript" src="JS/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
function loadpage(x)
{
$('#centre').empty().load(x, function () {
window.alert('Request complete');
});
}
</script>
<style type="text/css">
<!--
#main {
position:absolute;
left:0px;
top:0px;
width:100%;
height:100%;
z-index:1;
}
#header {
position:absolute;
left:0px;
top:0px;
background:url(Images/header1.png);
-moz-background-size: auto, cover; /* Firefox 3.6 */
background-size: auto, cover; /* Chrome, Firefox 4.0+, Safari 4.1+, Opera 10+ and IE9 */
width:100%;
height:14%;
overflow: hidden;
z-index:250;
}
#centre {
position:absolute;
left:0px;
top:14%;
width:100%;
height:82%;
z-index:240;
}
#smoothmenu1 {
position:absolute;
right:0px;
width:40%;
bottom:0px;
height:26px;
overflow: hidden;
z-index:220;
}
#footer {
position:absolute;
left:0px;
bottom:0px;
width:100%;
height:4%;
overflow: hidden;
z-index:2;
}
.com {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
#cntr {
position:absolute;
left:0px;
top:-1px;
width:100%;
height:100%;
z-index:50;
}
#insideCentre {
position:absolute;
left:0px;
top:10%;
width:100%;
height:90%;
z-index:12;
}
#initProfile {
position:absolute;
left:0px;
top:0px;
width:70%;
-moz-border-radius:12px;
-webkit-border-radius:12px;
border-radius:14px;
height:100%;
z-index:14;
}
.aFont
{
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
font-size:20px;
color:#FFF;
padding-top: 2px;
}
#aboutMSL {
position:absolute;
left:0px;
top:0px;
width:100%;
height:10%;
-moz-border-radius:12px;
-webkit-border-radius:12px;
border-radius:12px;
background:url(Images/gclip.png);
overflow: hidden;
z-index:18;
}
#aboutBody {
position:absolute;
left:0px;
top:14%;
width:100%;
height:86%;
border-right-color:#666;
border-left-style:dotted;
overflow: hidden;
border-left-width:thin; z-index:23;
}
#tech {
position:absolute;
top :50%;
right:0px;
-moz-border-radius:12px;
-webkit-border-radius:12px;
border-radius:12px; width:30%;
height:30%;
z-index:19;
}
#tech_header {
position:absolute;
left:0px;
top:0px;
width:100%;
height:30%;
-moz-border-radius:12px;
-webkit-border-radius:12px;
border-radius:12px;
background:url(Images/gclip.png);
overflow: hidden;
z-index:20;
}
#tech_body {
position:absolute;
left:0px;
bottom:10%;
width:100%;
height:50%;
z-index:21;
overflow: hidden;
}
.sFont {
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
}
#sShow {
position:absolute;
top:0px;
right:0px;
width:30%;
height:40%;
z-index:51;
}
-->
</style>
</head>
<body>
<div id="main">
<div id="header">
<div id="smoothmenu1" class="ddsmoothmenu">
<ul>
<li><a href="#" onclick="loadpage('a.html')">A</a></li>
<li><a href="#" onClick="loadpage('c.html')">S</a></li>
<li><a href="#" onclick="loadpage('v.html')">C</a></li>
<li><a href="#">Commx</a></li>
<li><a href="#" onclick="loadpage('b.html')">V</a></li>
</ul>
<br style="clear: left" />
</div>
</div>
<div id="centre">
</div>
<div id="footer" align="center" class="com" >Commision</div>
</div>
</body>
</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=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#top {
position:absolute;
left:0px;
top:0px;
width:100%;
height:10%;
background:url(Images/gclip.png);
z-index:3;
}
#c1 {
position:absolute;
left:0px;
top:0px;
width:100%;
height:25px;
overflow:hidden;
margin-top:25px;
z-index:5;
border-bottom: 0.5px solid #778;
}
</style>
</head>
<body>
<div id="PCentre">
<div id="c1">Column 1</div>
<div id="Pbody"></div>
</div>
</body>
</html>
我正在尝试使用查询将第二个 html 页面加载到第一个 html 页面的中心 div 中,该应用程序在 Firefox 中运行良好,但在 chrome 中无法正常工作,在 chrome 中,第 2 页中的 div 元素没有像我运行它时那样放置Firefox 中的应用程序(我尝试从 localhost/127.0.0.1 运行应用程序)