注意歌的路径。。贴一段背景音乐的代码你看<!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=gb2312" />
<title>无标题文档</title>
</head><body>
<script LANGUAGE="JavaScript">
<!-- Begin
var browsername = navigator.appName;
var gettype = browsername;
if (gettype=="Netscape") {
document.write('<embed src="红叶斜落我心寂寞时-钟镇涛.wma" autostart=true WIDTH=196 HEIGHT=49 REPEAT=TRUE>');} else {
alert("dd");
document.write('<BGSOUND SRC="红叶斜落我心寂寞时-钟镇涛.wma" autostart=true loop=false>')
}
//-->
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<script LANGUAGE="JavaScript">
<!-- Begin
var browsername = navigator.appName;
var gettype = browsername;
if (gettype=="Netscape") {
document.write('<embed src="红叶斜落我心寂寞时-钟镇涛.wma" autostart=true WIDTH=196 HEIGHT=49 REPEAT=TRUE>');} else {
alert("dd");
document.write('<BGSOUND SRC="红叶斜落我心寂寞时-钟镇涛.wma" autostart=true loop=false>')
}
//-->
</script>
</body>
</html>
我想对路径的
我的代码如下<bgsound src='' loop='1' id="snd">
<script>
function playSound(){
var _s = document.getElementById('snd');
_s.src = "msg.wav";
}
function run(){
playSound();
setTimeout("run()",3000);
}
playSound();
</script>
<input type="button" value="声音" onclick="run()">
_s.src = "http://localhost/msg.wav";
都不行?
<head></head>
<body>
<script>
function playSound(){
alert("dd");
var _s = document.getElementById('snd');_s.src = "msg.wav";}
function run(){
playSound();
setTimeout("run()",3000);
}
</script>
<bgsound src='' loop='1' id="snd">
<script>
playSound();
</script></body>
</html>
为什么要用flash
我在说一次脚本运行绝对正常,只是没有出声音而已,而且脚本绝对运行了alert我早就试验过了难道php这样的话就这么难吗?
以html方式运行url是什么?
是直接在本地放置一个html文件,然后双击该文件;
还是在地址栏内输入http://....xx/xx.html ?楼主可以分别贴下你两种方式的url吗?
以html方式运行url是什么?
是直接在本地放置一个html文件,然后双击该文件;
还是在地址栏内输入http://....xx/xx.html ?楼主可以分别贴下你两种方式的url吗?
<bgsound src='' loop='1' id="snd">
<script>
function playSound(){
var _s = document.getElementById('snd');
_s.src = "abc.wma";
}
function run(){
playSound();
//setTimeout("run()",3000);
}</script>
<input type="button" value="声音" onclick="run()">可以听见啊,,是你的音乐有问题不成。........