如何从另一个div标签打开div标签上的页面?

Gil*_*eed 0 html javascript

我是html和javascript的初学者.我在#top_Bar中创建了一个链接.当我点击链接时,我想要在#All_songlist上加载页面.但我在#All_songlist中看到的只是这两个词"music.html"而不是"music.html"的内容.我哪里做错了?我对innerHTML的作用有点困惑.我想这样做而不使用<iframe>标签.

<div id="top_Bar">
     <a href=" file:///F:/music.html"  onclick="load_songlist()"> SONG LIST </a> 
</div>

<div id="All_songlist"> </div>
Run Code Online (Sandbox Code Playgroud)

javascript上的代码是:

 function load_songlist(){
          document.getElementById("All_songlist").innerHTML="music.html";
 }
Run Code Online (Sandbox Code Playgroud)

Mat*_*uld 5

使用jQuery库很容易.使用jQuery的load()功能:

function load_songlist(){
    $('#All_songlist').load('music.html');
}
Run Code Online (Sandbox Code Playgroud)

要将jQuery库添加到当前页面,请将以下代码添加到您的<head>:

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
Run Code Online (Sandbox Code Playgroud)