473,624 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

my javascript works in IE but not in Firefox :(

2 New Member
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 1342
drhowarddrfine
7,435 Recognized Expert Expert
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 Recognized Expert Expert
Heya, Hardcorey. Welcome to TSDN!

Have a look at this article.
Aug 4 '07 #3
hardcorey
2 New Member
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
1933
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 (in)validate my Javascript code. First, I'll describe the purpose of the Javascript code. I often have a need to post a URL to something at my own web site, e.g., http://www.standards.com/Sorting/SortPerformanceComparison-Description.html. It is...
5
2213
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 in IE, though. I know, IE is a bit more permissive than IE, and sometimes lets errors work when they shouldn't. But from what I can see, I just don't see what's wrong.
6
3557
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 referenced in the script so I presume that Firefox needs to be added somewhere -- does anyone know how I could update this to be supported by Firefox? Thanks! <SCRIPT TYPE="text/JavaScript">
14
5450
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 that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I have been able to come. I added a little asp.net code and an asp.net button and cannot get it to
2
1817
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 (server side), which injects javascript along the lines of: location = '#buttons'; I use this so that, following postback, I can just back down to the relevant part of the page.
8
3653
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
2321
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
3426
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 no buttons react to clicking. The website's helpdesk says it should work with Firefox, and could not offer any more advices. The JavaScript Console shows that there are numerous errors occuring. It looks like the web browser does not recognise...
12
2577
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 than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; oFoldMenu.make('sub3','')//spacer unfortunately, i have just viewed the site in IExplorer and it has added...
6
1887
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 file, activation.js. I have put a script tag in the header, and everything works fine in Internet Explorer 7 and Opera 9. However, the script is not being called in Firefox 2. I can tell that the script is not being called because I put a...
0
8238
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8478
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.