Click to See Complete Forum and Search --> : Whats wrong with this script?


Zero-x252
07-30-2003, 12:29 PM
what did i do wrong in this script? i get the error on line 6 character 1. I need the function to work on the click of a button which it should but i'm not sure now that i apparently screwed it up...
function bgmusic() {
var bgm = prompt('Use what file/url as background music?')
while (bgm = "") {
document.write("")
}
else (bgm != "") {
document.write('<bgsound src="bgsound(bgm)"></bgsound><embed src="bgsound(bgm)"></embed>')
}
}

Jonathan
07-30-2003, 12:37 PM
My guess would be that you are comparing somehting in an else

pyro
07-30-2003, 12:39 PM
Yep, you probably meant:

if (bgm != "") {

Zero-x252
07-30-2003, 12:58 PM
Ah yes i knew there was something wrong in that general area i didn't think it was the else statement i think it was the fact that thats what i used...;)