That's a good question. I'm not sure what is the answer to your question. I'll do some research and get back to you if I got an useful answer. You should email the people at iPage as they probably can answer it..
Hi Ty;.
Yep, exposure is everything..
Gregory;.
I think that will throw an error..
Try this:.
<BODY>.
<BGSOUND id=BGSOUND_CTRL src="http://YourDomain/YourMidi.mid">.
<a href="#" onClick=document.all['BGSOUND_CTRL'].src="">Stop Music</a>.
....Willy..
Just read this post, willy - I did your code and it worked just one thing I wanna know tho, how do you put a code 2 make it start again? just wondering like, handly little code 2 have.
Joe..
Try adding an URL..
<a href="#" onClick=document.all['BGSOUND_CTRL'].src=".
Http://YourDomain/YourMidi.mid.
">Start Music</a>.
....Willy..
Here's a one button toggle script:.
In case that is what you were really asking..
<BODY>.
<BGSOUND id=BGSOUND_CTRL src=".
Http://YourMidi.mid">.
<script type="text/javascript">.
Var flip = "Stop Music";.
Function toggle() {.
If (flip == "Stop Music") {.
Flip = "Start Music";.
Document.all['BGSOUND_CTRL'].src="".
Str ='<input name="dUit" type="button" value="Start Music" ';.
Str+='class="midCtrl" onclick="toggle();">';.
Document.getElementById('midCtrl').innerHTML=str;.
}.
Else {.
Flip = "Stop Music";.
Document.all['BGSOUND_CTRL'].src=".
Http://YourMidi.mid.
".
Str ='<input name="dUit" type="button" value="Stop Music"';.
Str+='class="midCtrl" onclick="toggle();">';.
Document.getElementById('midCtrl').innerHTML=str;.
}.
}.
</script>.
<div id="midCtrl" class="midCtrl">.
<input name="dUit" type="button" class="midCtrl" value="Stop Music" onclick="toggle();">.
</div>.
....Willy..
Well it was the first code I was looking for but I couldnt get that to work :S never mind the second one works thanx m8..
Ok maybe I was wrong, it dosent work! the stop button works fine but the start button dosent work?.
WTF!.
If it aint 2 much trouble could you send me a zip file wit a .mid file and the code in HTML format so I can see one that works?.
Appreciated Joe..
Joe;.
I would be more than happy to zip it up for you..
But.
First.
Post what you have and we should.
Be able to spot what you are doing wrong..
There is no reason the 1st 'Start' button wouldn't.
Work as long as you have the path to the midi correct..
I just CC&P'ed the codes for the 1 button script from.
My post, added a midi URL and it worked as intended..
Insure that your path to your midi is correct and.
If that doesn't work, post what you have so far..
....Willy..
I use it on my iPage website for my music control, no errors..
I think I can see another scoutt in this here willy... I dont know what it is... hmmmmm..
I tried your code. It did not work! It.
Was.
Throwing errors..
I only said it might throw an error to be polite..
Post a page it works on......
As for the rest of your comments..
I come here to learn and help if I can..
Not play petty ego games..
Do us both a favor and put me on your.
Ignore list as I have done you..
*******.
....Willy..
WOW! chill lads lol..
The code I had was the exact same code you posted :.
<BODY>.
<BGSOUND id=BGSOUND_CTRL src="http://YourMidi.mid">.
<script type="text/javascript">.
Var flip = "Stop Music";.
Function toggle() {.
If (flip == "Stop Music") {.
Flip = "Start Music";.
Document.all['BGSOUND_CTRL'].src="".
Str ='<input name="dUit" type="button" value="Start Music" ';.
Str+='class="midCtrl" onclick="toggle();">';.
Document.getElementById('midCtrl').innerHTML=str;.
}.
Else {.
Flip = "Stop Music";.
Document.all['BGSOUND_CTRL'].src="http://YourMidi.mid".
Str ='<input name="dUit" type="button" value="Stop Music"';.
Str+='class="midCtrl" onclick="toggle();">';.
Document.getElementById('midCtrl').innerHTML=str;.
}.
}.
</script>.
<div id="midCtrl" class="midCtrl">.
<input name="dUit" type="button" class="midCtrl" value="Stop Music" onclick="toggle();">.
</div>.
I changed the file names to the location where my audio file was stored and when I open the page it plays fine, I click stop, that works but then when I press the start button again.... NOTHING! dont know whats wrong, I cant see any problems..
Cheers m8 Joe..
Hi Joe;.
I CC&p'ed the script from your post and it worked on my end..
Not sure what the problem is on your end. What browser are you using?.
Try this code. I left a path to a midi in one of my directories..
<BODY>.
<BGSOUND id=BGSOUND_CTRL src="http://transload.net/~cyberrite/Audio/Midi/Country/Trouble.mid">.
<script type="text/javascript">.
Var flip = "Stop Music";.
Function toggle() {.
If (flip == "Stop Music") {.
Flip = "Start Music";.
Document.all['BGSOUND_CTRL'].src="".
Str ='<input name="dUit" type="button" value="Start Music" ';.
Str+='class="midCtrl" onclick="toggle();">';.
Document.getElementById('midCtrl').innerHTML=str;.
}.
Else {.
Flip = "Stop Music";.
Document.all['BGSOUND_CTRL'].src="http://transload.net/~cyberrite/Audio/Midi/Country/Trouble.mid".
Str ='<input name="dUit" type="button" value="Stop Music"';.
Str+='class="midCtrl" onclick="toggle();">';.
Document.getElementById('midCtrl').innerHTML=str;.
}.
}.
</script>.
<div id="midCtrl" class="midCtrl">.
<input name="dUit" type="button" class="midCtrl" value="Stop Music" onclick="toggle();">.
</div>.
....Willy..
I copeied your code and I realised what I had done, I was putting in <HTML>, <TITLE> and all the usual stuff, now JUST using the exact code you gave it works fine, cheers m8.
By the way I like the music on your file lol, getting jiggy 2 it right now!..

