473,320 Members | 1,876 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,320 software developers and data experts.

Bgsound onclick() javascript

Dears
I am trying to run a simple bgsound script. But i dont know why its not working. The code is as follows.
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. function changeBgSound(arg){
  3. document.getElementById("mysound").src=arg;
  4. }
  5. </script>
  6. <body>
  7. <bgsound id="mysound" src="cphfinan.wav">
  8.  
  9. <a href="soundtest.html" onClick="changeBgSound('cphfinan.wav')"><img src="favicon.ico"></a>
  10.  
  11. </body>
  12.  
I would be extremely obliged for anyone's favourable response in this regard.

Thanks & Regards
Muhammad Qaiser
Jan 10 '11 #1
4 3594
RamananKalirajan
608 512MB
Whether this HTML file is soundtest.html?

Thanks and Regards
Ramanan Kalirajan
Jan 11 '11 #2
Yes you are right. its the same file.
Jan 12 '11 #3
rnd me
427 Expert 256MB
bgsound is a really old way to do play audio in JavaScript; im surprised you can hear anything at all.

you can try changing the A's href from href="soundtest.html" ta href="#" and see if that helps, but i think bgsound is loaded upon pageload, and so it won't reload until the page does.

use the <audio> tag to play sound, falling back to <embed>.
Jan 13 '11 #4
thanks alot for your response. i have done the same using javascript.

Anyways thaaanks alot to both the responders.

Regards
Jan 13 '11 #5

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

Similar topics

5
by: Jim Bond | last post by:
Hello, I have found myself in the position of having to manage & "hack" a web site built by someone else. I am trying to make a modification to the javascript code and have been unable to get...
2
by: Cathy | last post by:
Has anyone ever made a webform button run an onClick event that is a Javascript in the HTML code and then after running the script make it go into the code-behind? An HTML button will run the...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
0
by: Ryan Taylor | last post by:
Hello. I am having another issue. I need to execute some JavaScript whenever a radio button is clicked. I am currently using a RadioButtonList control to generate the radio buttons because of...
8
by: nkoriginal | last post by:
Hi: (this is a dummy question, I know, but I tried many times and I cant) I need to insert this javascript option inside the input, I can't insert any funtion in <head> I've this two...
2
by: quelle | last post by:
I have a TabContainer with three TabPanels. What I'd like to do is call a javascript function (with some custom parameters) every time a tab is clicked. Here is a simplified example: ...
1
by: jobs | last post by:
re: Attributes.Add Onclick (javascript) trapping CANCEL Hello. The following asp.net/vb.net code produces a confirmation Submitbutton.Attributes.Add("onClick", "return confirm('Is this...
7
gskoli
by: gskoli | last post by:
Dear all, Let me tell you the scenario , i have called javascript function on radio button selection , Ex. Suppose There are 3 Radio Button . Let us consider i have clicked on one radio...
0
by: Greg Ronald | last post by:
Hi - totally ignorant on javascript need some help, getting the above error, my code is; if('{!Event.Audit_Id__c}' == '') { window.location.href =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.