thibo1025 Posted February 10, 2006 Share Posted February 10, 2006 I have a dropdown form using java to have a sound on the page and 1 want to make it compatible with FF my script is this <html> <head><title>title</title><script LANGUAGE="JavaScript"><!-- Begin songNum = new Array(); songNum[0] = "#"; songNum[1] = "song_1.mp3"; songNum[2] = "song_2.mp3";var music = null;var track = 0;var ver = navigator.appName;function audioCheck(plugName) {for (var i = 0; i < navigator.plugins.length; i++) {if (navigator.plugins[i].name.toLowerCase() == plugName.toLowerCase()) {for (var j = 0; j < navigator.plugins[i].length; j++) {if (navigator.plugins[i][j].enabledPlugin) {return true; }}return false; }}return false;}function chooseSong(s) { // ietrack = s.options[s.selectedIndex].value; if (ver == "Microsoft Internet Explorer") {document.all.music.src = songNum[track]; } else {songPlay('play'); }}function songPlay(cmd) { // netscapeif (audioCheck("LiveAudio")) {if (cmd == 'play') {document.musicSource.play(false, songNum[track]); }} else {alert("Sorry this option is only compatible with internet Explorer"); }}// End --> </script></head><body><script language="JavaScript"><!-- Beginvar ver = navigator.appName;if (ver == "Microsoft Internet Explorer") {document.write('<bgsound src="#" ID=music loop="1" AUTOSTART=true>');} else {document.write('<embed type="audio/midi" src="#" AUTOSTART=true hidden=true VOLUME="90" name="musicSource" MASTERSOUND></EMBED>');}// End --></script> <form name=choose> <select size=1 name=track onChange="chooseSong(this);"> <option value="0">Choose your song</option> <option value="1">Song_1</option> <option value="2">Song_2</option> </select></form></body></html> tell me how I can make it compatible with FF.Or is there an easier way to do this? I mean more efficent and with less code. Link to comment Share on other sites More sharing options...
ZmanZL Posted February 11, 2006 Share Posted February 11, 2006 If you go to Tools> Javascript Console in Firefox It will show you all the errors in the code. Once they are fixed it should run on Firefox. Link to comment Share on other sites More sharing options...
thibo1025 Posted February 23, 2006 Author Share Posted February 23, 2006 true but cant you tell me the codes that can help me because I have a lot of problems with javascript Link to comment Share on other sites More sharing options...
thibo1025 Posted February 28, 2006 Author Share Posted February 28, 2006 actually I need to know the way of doing it in FF or to hide it in FF so that the people using FF do not see what dose not work on FF Link to comment Share on other sites More sharing options...
scott100 Posted February 28, 2006 Share Posted February 28, 2006 actually I need to know the way of doing it in FF or to hide it in FF so that the people using FF do not see what dose not work on FF<{POST_SNAPBACK}> To hide it search google for a javascript browser detection script thenif (browser=="Internet Explorer"){ code here}else{ alert("you are not using ie")} Link to comment Share on other sites More sharing options...
thibo1025 Posted March 1, 2006 Author Share Posted March 1, 2006 and if I want it to work with FF...what kind of code should I use? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now