在div标签内嵌入查询

时间:2015-01-15 19:17:48

标签: javascript jquery html html5

这不是完整的html页面!播放列表本身完美无缺,它可以在我的html文件中运行,但我不知道如何将它嵌入到名为contentStory的div标签中。 谁能帮我?我确信这很简单。这是路吗? $('body')应该是div标签的绝对路径吗?对于技术开发人员,抱歉这样一个愚蠢的问题。

<head>
 <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
 <script type="text/javascript" src="../plugin/jquery-jplayer/jquery.jplayer.js"></script>
 <script type="text/javascript" src="../plugin/ttw-music-player-min.js"></script>
 <script type="text/javascript" src="js/myplaylist.js"></script>

 <script type="text/javascript">
    $(document).ready(function(){
        var description = 'This is ipsum dolor sit amet, consectetur adipiscing elit. Fusce id tortor nisi. Aenean sodales diam ac lacus elementum scelerisque. Suspendisse a dui vitae lacus faucibus venenatis vel id nisl. Proin orci ante, ultricies nec interdum at, iaculis venenatis nulla. ';

        $('body').ttwMusicPlayer(myPlaylist, {
            autoPlay:false, 
            description:description,
            jPlayer:{
                swfPath:'music-player/plugin/jquery-jplayer' //You need to override the default swf path any time the directory structure changes
            }
        });
    });
  </script>
  </head>
  <body class="wireframe">
  <div id="page">
  <header>.....</header>
  <div>….</div>
  <div>….</div>
  <div>….</div>
  <div>….</div>
  <div>….</div>
  <div id="contentStory"></div>
  <footer>….</footer>

  </body>
  </html>

1 个答案:

答案 0 :(得分:1)

使用contentStory ID找到它

$('#contentStory').ttwMusicPlayer(myPlaylist, {
       autoPlay:false, 
       description:description,
       jPlayer:{
            swfPath:'music-player/plugin/jquery-jplayer' //You need to override the default swf path any time the directory structure changes
       }
});