Help needed

walidos

New Member
Hello ^^

I am currently working on my first project! But i think im doing a bad job.
I have a small java function to play music with my own images inserted but this doesnt work on IE8 and ect... only on IE9.
I was wondering if there was anyone who could help me.

The website : www.djbobrambo.com

The javacode :
Code:
<img id="music" onclick="musicfunc()" src="images/buttons/on.png" width="195" height="20" style="float: center; padding-right: 50px; padding-top: 58px;"><OBJECT id="MediaPlayer" width="1" height="1" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"><PARAM name="URL" value="home.mp3"><PARAM name="AutoStart" value="True"><PARAM name="PlayCount" value="9999"></OBJECT><script type="text/javascript">var musicstat = "1";function musicfunc(){if(musicstat == "0"){document.getElementById ('music').src="images/buttons/on.png";musicstat = "1";document.getElementById("MediaPlayer").setAttribute("URL", "home.mp3");}else if(musicstat == "1"){document.getElementById ('music').src="images/buttons/off.png";musicstat = "0";document.getElementById("MediaPlayer").setAttribute("URL", "");}}</script>

Thank you.
 
Make it readable

I don't have an answer for you, but you might get more folks to look if you post the code with one line per statement or tag, so it is easier to read.

Also your function is Javascript, not Java.
 

walidos

New Member
I don't have an answer for you, but you might get more folks to look if you post the code with one line per statement or tag, so it is easier to read.

Also your function is Javascript, not Java.

Allright, thank you for your time. DO you know any other kind of code that can make it work? I have two images (on/off) and as soon as i click it the music will play.

Thank you in advance.
 
Top