|
Posted by Dan on 07/30/06 12:51
FH wrote:
> i have a web page that i want to play music automatically when someone
> visits it (i know, some of you hate that), but i'd still like to know the
> code for it. the code i show below used to play it , but now it jumps to a
> blank page and plays it there.
I have a page that both explains how to do it, and why you probably
shouldn't:
http://webtips.dan.info/sounds.html
> <title>My Home Page</title>
> </head>
> <a href="song.mp3"><font color="black">Click here to listen to sound</a>
> <BR>
The above code never made anything play "automatically"; it only played
when you followed the link to it, as it should. Your syntax is bad,
too; you left out the closing font tag which should be nested within
the <a>...</a>. As black is usually the default text color, you don't
really need to set that in a font tag anyway (and CSS, rather than font
tags, is the modern way of doing this). "Click here" is generally bad
link text (it's better to describe what the link goes to rather than
the mechanics of accessing it in some browsing environments. Whether
the .mp3 link works or not depends on browser (or plugin) support for
that format, as well as on whether the server the mp3 file is on is
sending the proper MIME type for the file.
--
Dan
Navigation:
[Reply to this message]
|