13 replies [Last post]
suavedesign
suavedesign's picture
Offline
Enthusiast
Last seen: 4 years 32 weeks ago
Timezone: GMT-5
Joined: 2010-12-01
Posts: 128
Points: 191

Hi,
I am trying to add sound to my web-site, when a link is clicked.
I added this javascript into the head of my doc:

<script language="javascript" type="text/javascript">
 function playSound('Swoosh 3-SoundBible.com-1573211927.wav') {
 document.getElementById("dummy").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 </script>

And I added this code into the body:
<span id="dummy"></span>

And this is what I added by the li that I want the sound to be heard on:
<li><a href="index.html" onclick="playSound('Swoosh 3-SoundBible.com-1573211927.wav');">Home</a></li>

I got this from http://webdesign.about.com/od/sound/a/play_sound_oncl.htm. But this does NOT work when I tested it my browser. NO sound is heard on the mouse-click.
Can anyone help please?
Thank you!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 10 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Why? Why would you want to do

Why?
Why would you want to do that?
Why do you hate your users so much??
Is this a test to just see how long it takes for them to quickly leave?
In short. Don't do this. Just don't.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

suavedesign
suavedesign's picture
Offline
Enthusiast
Last seen: 4 years 32 weeks ago
Timezone: GMT-5
Joined: 2010-12-01
Posts: 128
Points: 191

Woa! Why not?

Woa! Why not?
But anyways, I have to know how, this is for a client that I am building a website for, not for my own site.- this is what he requested. So please, can you help me out???
Thanks!!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 10 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

No. Don't hold it against the

No. Don't hold it against the forum, we'll help you with just about anything, but I'm not going to help with this specific issue out of principal. You're the professional, it's your job to explain to the client that this is not a good idea.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 4 hours 32 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9767
Points: 3849

Two points:

  1. It is your responsibility, as the web developer, to prevent your client from shooting himself in the foot. Site generated sounds are, from all usability tests, annoying to the visitor unless he initiated it. IOW, it's OK to have sound that he can start himself. It is not OK to dump it on him without his having opted in.
  2. Why is it annoying? He may already be listening to something, or he may prefer quiet. For example, I have Bessie1 Smith's recordings from 1923–1925 playing on the computator right now, and if a web site started making sounds every time I clicked on something, you can color me gone.

cheers,

gary

1 My nat/firewall machine's host name is Bessie, I'm on a Win7 machine named LaVerne (Baker), my main workstation is a Linux box named Aretha (Franklin), the laptop is Janis (Joplin), the about to be retired Linux box, a PⅢ2, is Koko (Taylor). Koko's sister machine is named Etta (James), and has 98se for IE6.

As you might imagine, I, like so many, enjoy choosing my own background sounds and absolutely resent some site owner thinking he knows better than me what I want to hear.

2 That 12 year old 733MHz, 256MByte PⅢ, running Linux still out-performs the dual core, 2.6GHz, 8GByte Win7 box except for serious graphics stuff. The new box's GPU has its own on-card dedicated 1GByte memory.

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

suavedesign
suavedesign's picture
Offline
Enthusiast
Last seen: 4 years 32 weeks ago
Timezone: GMT-5
Joined: 2010-12-01
Posts: 128
Points: 191

I tried explaining this to

I tried explaining this to the client, and he insists on having sound.
Again, this is my code:
In the ,

<script language="javascript" type="text/javascript">
 function playSound(soundfile) {
 document.getElementById("dummy").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 </script>

In the body:
<span id="dummy"></span>
And by the li that should have the sound:li><a href="index.html"onclick="playSound('Swoosh 3-SoundBible.com-1573211927.wav');">Home</a></li>

Is there anyone that can help me, please???
Thank you!!!

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 14 weeks 3 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

Not me. If someone's going

Not me. If someone's going to shoot himself in the face I don't load his gun.

Show the client this thread so he knows how stupid the request is.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 14 weeks 3 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

Ah, some other forum helped

Ah, some other forum helped this one to do the Seppuku. Another vulgarity is released to the internet.

What's the point? I'm just going to quit and let these hacks win. I quit. I QUIT!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Can you please provide your

Can you please provide your clients domain name so that I may add it to my hosts file and resolve it to 127.0.0.1.

I once asked my mechanic to tune my engine, make it go really fast and sound cool, he refused citing the stupidity of the request and the fact that I would be polluting the atmosphere, using up far more fuel than necessary, and would run foul of the omissions legislation and would get pulled over and fined. I remonstrated " but I'm the client you have to do what I want!" piss off and find another mechanic he said. I thought on this, came to my senses and reminded myself that he was the expert, and that I paid him partly to provide sound advice along with his skills to keep my car safe on the road.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

suavedesign
suavedesign's picture
Offline
Enthusiast
Last seen: 4 years 32 weeks ago
Timezone: GMT-5
Joined: 2010-12-01
Posts: 128
Points: 191

Thanks, guys. I showed my

Thanks, guys. I showed my client this thread, and he agreed to remove the sound! Thank you.

Would you be able to help me with something else, please?
There are two issues that my client sees on his computer (and others that he checked, he says) that I do not see on my computer.
1) He says that there is extra white space on the bottom of the website on FF
2) He says he sees some small orange line on the bottom of some of the pages of the website. (For example, on the page called "Patient Feedback")

I do not see any of these issues on my computer, though. Can anyone help me figure out how to solve these issues? I'd appreciate any help immensely. The link to this site is www.trecall.com.

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 10 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

The orange line the bottom

The orange line the bottom right corner is

<span class="cc_back" id="cc_back">back to menu</span>
<span class="cc_back_page" id="cc_back">back to page</span>

and since you have a negative right margin on them, they are just about all the way off the page, except for just a pixel or two of the background.

Not seeing any excessive white space at the bottom of the screen.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

suavedesign
suavedesign's picture
Offline
Enthusiast
Last seen: 4 years 32 weeks ago
Timezone: GMT-5
Joined: 2010-12-01
Posts: 128
Points: 191

Thanks a lot!! Great help,

Thanks a lot!! Great help, and much appreciated!

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 14 weeks 3 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

Thank you for convincing your

Thank you for convincing your client to make the internet just a little bit better. Smile

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

And thank you client for

And thank you client for heeding the advise even if some veil it in odd rambling similes, advice is always well intentioned even though strangely proffered.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me