怎样在Javascript 中通过点击一个按钮,打开一个播放音乐的新窗口

来源:百度知道 编辑:UC知道 时间:2024/06/25 18:18:04
以下是点击按钮后会转到一个播放Long Long Way To Go 的页面。
1.但是由于用了:document.write语句。会覆盖当前的页面。我需要点击按钮的时候,是“弹出”到播放界面,而不是“转到”播放界面。
2.怎样实现“弹出”到播放界面时连续播放多首歌曲。
3.obj 怎么用,getElementById()能解决这个问题吗?谢谢。非常感谢。希望帮忙。我还会追加分。
<html>
<head>
<title>Songs </title>
<script language ="javascript language" type="text/javascript">
function Song(){
document.write("<embed width='200' height='45' autostart='true' src='long long way to go.mp3';><p>Long Long Way To Go</p>");
}
</script>
</head>
<body>
<p><input type="button" value="Long Long Way To Go" onclick="Long()"></p>
</body>
</html>
onclick="song()" ,刚才打错了.不是Long();

function song(){
var newwindow=window.open("","newwindow","width=200,height=45");
var string="<html>";
string+="<body>";
string+="<embed width='200' height='45' autostart='true' src='long long way to go.mp3';><p>Long Long Way To Go</p>";
string+="</body>";
string+="</html>";
newwindow.document.write(string);
}
要给分啊,不会再找我也行:QQ121649525