[thelist] Cross browser help with JavaScript to trigger .wavfile.

Christian Heilmann codepo8 at gmail.com
Thu Dec 8 14:10:39 CST 2005


> Can you tell me what I should replace that code with?  I grabed it off the
> net and don't write JavaScript from scratch.
>
> Thanks for any help you can give.

First of all sorry if my first answer was a bit harsh, it was meant
well, you are down a road you can only master if you really know
JavaScript and different browsers.

Many thanks also to some brian88x who called my advice lame and
guessed I was a "limie"  who likes to orally stimulate male parts. It
is wonderful to spend time here and know that there are people reading
this who are not the average polite well-meaning list member but pose
a challenge.

I did give you the best advice possible - just replace the JavaScript
with a normal link to the WAV file. It is a very frustrating process
to add background music to an HTML document nowadays, with that many
browsers around, all supporting (or not supporting) this differently.
Especially as any feature might change in the next version.

The best way to add music to a page is via Flash, or just link your
sound file and let the visitor decide what to play it in.

One of the better tutorials on what can be done and why some other
things are outdated is here: http://webtips.dan.info/sounds.html

If you want to see the horror of different browser implementations in
all its glory, you can also see the explanations here:
http://www.webreference.com/js/column20/

There is also a short bit here which explains the normal object thingamajing:
http://webdesign.about.com/cs/multimedia/ht/htbgsound.htm

So, you'd need to add a object element for real^H^H^H^H newer browsers
and bgsound or embed for older browsers. Then you add an ID for
example to it and change the data or the src file depending on which
element was added.

Isn't it easier just to link the file?



More information about the thelist mailing list