473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

my javascript works in IE but not in Firefox :(

i basically have a couple songs that ive made on my site, and im using an onClick event to play each song. basically the onClick event calls the javascript function.

heres my javascript:



Expand|Select|Wrap|Line Numbers
  1. function playMusic(thisSong)
  2.     {
  3.         if(thisSong == 1)
  4.         {
  5.         document.getElementById('BGSOUNDID').src='blaze.mp3';
  6.         }
  7.         else if(thisSong == 2)
  8.         {
  9.         document.getElementById('BGSOUNDID').src='pianoman.mp3';
  10.         }
  11.         else if(thisSong == 3)
  12.         {
  13.         document.getElementById('BGSOUNDID').src='slow jam.mp3';
  14.         }
  15.  
  16.     }
  17.  
  18. function stopMusic()
  19.     {
  20.         document.getElementById('BGSOUNDID').src=''
  21.     }
heres my html:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <a onClick="playMusic(1)" style="cursor:pointer;">play</a>&nbsp;&nbsp; <a onClick="stopMusic()" style="cursor:pointer;">stop</a></br>
  3.  
  4.  
  5. <a onClick="playMusic(2)" style="cursor:pointer;">play</a>&nbsp;&nbsp; <a onClick="stopMusic()" style="cursor:pointer;">stop</a></br>
  6.  
  7. <a onClick="playMusic(3)" style="cursor:pointer;">play</a>&nbsp;&nbsp; <a onClick="stopMusic()" style="cursor:pointer;">stop</a>
  8.  
  9.  

this works wonders in IE, of course, but not at all in FireFox ( and there are no errors in the error console when i've clicked the play/stop buttons)

any help getting this to work in Firefox would be greatly appreciated

thanks!
Aug 4 '07 #1
3 1335
drhowarddrfine
7,435 Expert 4TB
It's <br /> assuming xhtml.
If you are using xhtml, then onclick must be lower case.
Try that.
Aug 4 '07 #2
pbmods
5,821 Expert 4TB
Heya, Hardcorey. Welcome to TSDN!

Have a look at this article.
Aug 4 '07 #3
i tried lowercasing the onClick...didnt do a thing for me...and PBMODS: this is a project so i really want to do this mostly by my lonesome, but i just didnt know if there were certain tags or elements in Javascript that wouldnt be recognized in Firefox...i talked to a friend last night, and he said it probably works in IE and not in Firefox (with no errors) b/c IE is calling up a player, most like WMP, and Firefox isnt doing this.

could this be true?
Aug 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Howard Kaikow | last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is either a bug in Firefox or a bug in my Javascript code. I'll try to explain the problem, hoping that this newsgroup can...
5
by: LRW | last post by:
(Sorry if this is a repost...my newsreader keeps crashing on the posting--I don't know if the message going out or not) For some reason this javascript just won't work in Firefox. It works fine...
6
by: Cliff R. | last post by:
Hi, I use a handy little Javascript Flash detection script on a number of sites (copied below). Usually works great, but I just started trying Firefox and it's not working. A few browsers are...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
2
by: John | last post by:
I've been working on making my ASP.NET web apps compatible with Firefox (the uplevel configs for web.config are a real help). However, one really weird thing is a GotoAnchor() function I have...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
6
by: davidiwharper | last post by:
Hi there. I'm putting together a page to collect some information from our website users and send the administrator an email. To this end I have some Javascript form validation in an external...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.