A
ArbolOne
I would like to play a wave file in my web page, for that have written
a javascipt but to no avail. Using http://www.jslint.com/ I have found
the following errors:
============
Error:
Implied global: alert 3, document 18, navigator 8
Problem at line 18 character 9: document.write can be a form of eval.
document.writeln('<bgsound src="' + soundfile + '" loop=1>');
Problem at line 21 character 5: document.write can be a form of eval.
document.writeln('<embed src="' + soundfile + '" autoestart=true
loop=false ...
======================
function backgroundPlayer( soundfile ){
var browserName = navigator.appName;
var bsrMSIE = "Microsoft Internet Explorer";
var brsFirefox = "Netscape";
if(browserName == bsrMSIE){
document.writeln('<bgsound src="' + soundfile + '" loop=1>');
}
else if(browserName == brsFirefox){
document.writeln('<embed src="' + soundfile + '" autoestart=true
loop=false width=2 height=0>');
}
}
=====================
what am I doing wrong??
Thanks in advance
a javascipt but to no avail. Using http://www.jslint.com/ I have found
the following errors:
============
Error:
Implied global: alert 3, document 18, navigator 8
Problem at line 18 character 9: document.write can be a form of eval.
document.writeln('<bgsound src="' + soundfile + '" loop=1>');
Problem at line 21 character 5: document.write can be a form of eval.
document.writeln('<embed src="' + soundfile + '" autoestart=true
loop=false ...
======================
function backgroundPlayer( soundfile ){
var browserName = navigator.appName;
var bsrMSIE = "Microsoft Internet Explorer";
var brsFirefox = "Netscape";
if(browserName == bsrMSIE){
document.writeln('<bgsound src="' + soundfile + '" loop=1>');
}
else if(browserName == brsFirefox){
document.writeln('<embed src="' + soundfile + '" autoestart=true
loop=false width=2 height=0>');
}
}
=====================
what am I doing wrong??
Thanks in advance