相关疑难解决方法(0)

如何使用jquery将整个html页面放在div中?

首先,我希望每个人都知道我是绝对的初学者所以请耐心等待我.

我想知道如何将整个html页面放在div中.我试过$("#footballPlayers").html("footballplayers.html");但它显示footballplayers.html文本而不是整个页面.

index.html的:

<html>
<head>
<script type="text/javascript" src="jquery1.6.4min.js"></script>
<script type="text/javascript">
 $(function(){
  $("div#tabFootballPlayers").click(function(){
    $("#footballPlayers").html("footballplayers.html");
    $("#actionStars").html("");
    $("#directors").html("");
  });
 });

 $(function(){
  $("div#tabActionStars").click(function(){
   $("#actionStars").html("actionstars.html");
   $("#footballPlayers").html("");
   $("#directors").html("");
  });
 });

 $(function(){
  $("div#tabDirectors").click(function(){
   $("#directors").html("directors.html");
   $("#actionStars").html("");
   $("#footballPlayers").html("");
  });
 });
</script>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div>
 <div id="tabFootballPlayers">Football Players</div>
 <div id="footballPlayers"> </div>
 <div id="tabActionStars">Action Stars</div>
 <div id="actionStars"> </div>
 <div id="tabDirectors">Directors</div>
 <div id="directors"> </div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html jquery

5
推荐指数
4
解决办法
3万
查看次数

标签 统计

html ×1

jquery ×1