468,733 Members | 1,491 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,733 developers. It's quick & easy.

Play a sound when clicking a hyperlink?

Hi, is there a way to play a small sound snippet when a user clicks a
certain hyperlink hotspot on an image?

Thanks in advance.
Mar 17 '06 #1
16 2690
In article <w3*****************@text.news.blueyonder.co.uk> ,
"Chris Ianson" <no***@hotmail.com> wrote:
Hi, is there a way to play a small sound snippet when a user clicks a
certain hyperlink hotspot on an image?

Thanks in advance.


You mean like the first long chord from a Jimi Hendrix's Star
Spangle maybe?

--
dorayme
Mar 18 '06 #2
With neither quill nor qualm, Chris Ianson quothed:
Hi, is there a way to play a small sound snippet when a user clicks a
certain hyperlink hotspot on an image?


Image Map and Object, but will the visitor hear it if he/she browses
with sound off as I suspect many do?

--
Neredbojias
Contrary to popular belief, it is believable.
Mar 18 '06 #3
Chris Ianson said the following on 3/17/2006 5:51 PM:
Hi, is there a way to play a small sound snippet when a user clicks a
certain hyperlink hotspot on an image?


My browser makes a clicking noise already when I click links. It's the
way *I* want it - not you.

But, trying to play a sound on a PC without speakers should be an
entertaining project.

The answer is no. Well, not in the groups you posted to anyway.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 18 '06 #4
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
will the visitor hear it if he/she browses
with sound off


If it is _very_ loud, of course, he/she will....

--
dorayme
Mar 18 '06 #5
With neither quill nor qualm, dorayme quothed:
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
will the visitor hear it if he/she browses
with sound off


If it is _very_ loud, of course, he/she will....


If it is very loud, it has to occur. Since it can't occur, it can't be
loud. My opinion of Martian intelligence has plummeted lately.

--
Neredbojias
Contrary to popular belief, it is believable.
Mar 18 '06 #6
"Sid Ismail" <el***@nospam.co.za> wrote in message
news:gs********************************@4ax.com...
I also don't like it.

Search Google for "playing sound while surfing".


Perhaps you can all help me add a 'sounds on/off' button to my page then
also. :)

What I'd like is a constant looping background MP3 (it will just be quiet
'street noise'), and a specific sound when they click any hyperlink, but
that option to turn sounds on/off.

Anyone here got the know-how?

Thanks in advance.
Mar 18 '06 #7
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
With neither quill nor qualm, dorayme quothed:
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
will the visitor hear it if he/she browses
with sound off


If it is _very_ loud, of course, he/she will....


If it is very loud, it has to occur. Since it can't occur, it can't be
loud. My opinion of Martian intelligence has plummeted lately.


Boji, you have been badly affected by being in BdeZ's killfile.
Try to imagine a sound that is so loud that it breaks all logical
barriers and just roll about the floor in paroxysms of laughter
at this instead of casting aspersions on Martian intelligence.

Look, I know it will be bad when you meet Officer Bud White. I
know it is troubling you. But it will not be the end of the world
and you will emerge a better and stronger man.

And, btw, don't stir up that "mad hatter" crowd, a few of their
threads have (after a long absence) started appearing, complete
with foul language, on my newsreader.

--
dorayme
Mar 19 '06 #8
With neither quill nor qualm, dorayme quothed:
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
With neither quill nor qualm, dorayme quothed:
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:

> will the visitor hear it if he/she browses
> with sound off

If it is _very_ loud, of course, he/she will....
If it is very loud, it has to occur. Since it can't occur, it can't be
loud. My opinion of Martian intelligence has plummeted lately.


Boji, you have been badly affected by being in BdeZ's killfile.
Try to imagine a sound that is so loud that it breaks all logical
barriers and just roll about the floor in paroxysms of laughter
at this instead of casting aspersions on Martian intelligence.


BdeZ's killfile is like the Devil's Island of the Information Highway.
You can't imagine the depths of depravity and insouciance suffered by
denizens of that digital deep. Oh...what am I talking about? You're
there, too. That explains it.
Look, I know it will be bad when you meet Officer Bud White. I
know it is troubling you. But it will not be the end of the world
and you will emerge a better and stronger man.

And, btw, don't stir up that "mad hatter" crowd, a few of their
threads have (after a long absence) started appearing, complete
with foul language, on my newsreader.


I don't view them as a crowd, I view each as an individual with a unique
persona and responsible for his/her own commentary just as anyone would
be. Casually categorizing people into groups leads to discrimination
which I have found that Australians in particular are far from free of.

--
Neredbojias
Contrary to popular belief, it is believable.
Mar 19 '06 #9
Hello,

I don't know what I'm talking about, but might wrapping some text with
nested links work, one for the web page and one for the sound? Lacking
that, you could use a Javascript onClick() event handler to redirect
them after clicking the link, but you'd be dependent on them having
Jscript turned on (which 95% of people do anyway).

Mar 19 '06 #10
Ja*********@gmail.com wrote:
Hello,

I don't know what I'm talking about, but might wrapping some text with
nested links work, one for the web page and one for the sound? Lacking
that, you could use a Javascript onClick() event handler to redirect
them after clicking the link, but you'd be dependent on them having
Jscript turned on (which 95% of people do anyway).


You cannot nest links...a hack employed by black-hats on the web to do
very nasty things, up to date modern browsers will not fall for the trick.

TIP: in the future quote the part of the message that you are replying
to. Many folks use real newsreaders and not via webpage as Google Groups
and we do not see all the messages in a thread in a single window.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Mar 19 '06 #11
<Ja*********@gmail.com> wrote in message
news:11********************@g10g2000cwb.googlegrou ps.com...
Hello,

I don't know what I'm talking about, but might wrapping some text with
nested links work, one for the web page and one for the sound? Lacking
that, you could use a Javascript onClick() event handler to redirect
them after clicking the link, but you'd be dependent on them having
Jscript turned on (which 95% of people do anyway).


Thanks for a sensible reply to my question which was 'how to' do it (not
'should I' and 'please give your opinion on if it's a bad idea').

Can you give an example of such code that will call a URL hyperlink and play
a sound when clicked please.

Cheers!
Mar 19 '06 #12
On Sun, 19 Mar 2006 11:38:25 +0100, Chris Ianson <no***@hotmail.com> wrote:
<Ja*********@gmail.com> wrote in message
news:11********************@g10g2000cwb.googlegrou ps.com...
I don't know what I'm talking about, but might wrapping some text with
nested links work, one for the web page and one for the sound?


Thanks for a sensible reply to my question which was 'how to' do it (not
'should I' and 'please give your opinion on if it's a bad idea').


Well, this is a usenet newsgroup. What this implies is
<URL:http://groups.google.com/group/alt.html/msg/846f8ab01cc63400>.

BTW: the nested links that are proposed, are not possible with html:

,------[ <URL:http://www.w3.org/TR/html401/struct/links.html#edef-A> ]
| 12.2.2 Nested links are illegal
|
| Links and anchors defined by the A element must not
| be nested; an A element must not contain any other
| A elements.
`------
--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
Mar 19 '06 #13
Chris Ianson wrote on 19 mrt 2006 in comp.lang.javascript:
<Ja*********@gmail.com> wrote in message
news:11********************@g10g2000cwb.googlegrou ps.com...
Hello,

I don't know what I'm talking about, but might wrapping some text
with nested links work, one for the web page and one for the sound?
Lacking that, you could use a Javascript onClick() event handler to
redirect them after clicking the link, but you'd be dependent on them
having Jscript turned on (which 95% of people do anyway).
Thanks for a sensible reply to my question which was 'how to' do it
(not 'should I' and 'please give your opinion on if it's a bad idea').


it seems a bad idea
Can you give an example of such code that will call a URL hyperlink
and play a sound when clicked please.

Cheers!


<bgsound src="silend.mid" id="song">

<a href="http://cnn.com/" onclick="return soundlink(this);">
Play Clip</a>

<script >
var where;
function soundlink(x){
where=x;
document.getElementById('song').src='3secSound.mid ';
setTimeout('location.href=where.href',3000);
return false;
}
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 19 '06 #14
Evertjan. wrote:
Chris Ianson wrote on 19 mrt 2006 in comp.lang.javascript:

<Ja*********@gmail.com> wrote in message
news:11********************@g10g2000cwb.googlegr oups.com...
Hello,

I don't know what I'm talking about, but might wrapping some text
with nested links work, one for the web page and one for the sound?
Lacking that, you could use a Javascript onClick() event handler to
redirect them after clicking the link, but you'd be dependent on them
having Jscript turned on (which 95% of people do anyway).


Thanks for a sensible reply to my question which was 'how to' do it
(not 'should I' and 'please give your opinion on if it's a bad idea').

it seems a bad idea

Can you give an example of such code that will call a URL hyperlink
and play a sound when clicked please.

Cheers!

<bgsound src="silend.mid" id="song">

<a href="http://cnn.com/" onclick="return soundlink(this);">
Play Clip</a>

<script >
var where;
function soundlink(x){
where=x;
document.getElementById('song').src='3secSound.mid ';
setTimeout('location.href=where.href',3000);
return false;
}
</script>

I like that idea 'cuz it will NOT work in my browser! You will only
annoy IE users. I also recall your cannot script it to turn on or off
the sound like Netscape's attempt at this with EMBED, it is background
sound *only* where you can control the looping and initial delay in
playing when the pages loads. Also your document will not validate with
BGSOUND element it was never part of HTML.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Mar 19 '06 #15
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
And, btw, don't stir up that "mad hatter" crowd, a few of their
threads have (after a long absence) started appearing, complete
with foul language, on my newsreader.
I don't view them as a crowd, I view each as an individual with a unique
persona and responsible for his/her own commentary just as anyone would
be.


Boji, I have reinstructed Officer Bud White. Rather than give you
an education, I have told him to get one from you. I have told
him to accept on trust that you will treat him fairly on his
individual merit. In practical terms this means he will offer no
resistance and you can beat him into a pulp.
Casually categorizing people into groups leads to discrimination
which I have found that Australians in particular are far from free of.


Australians in particular eh? I take it that this categorization
is not casual.

--
dorayme
Mar 19 '06 #16
With neither quill nor qualm, dorayme quothed:
In article <MP************************@news.isp.com>,
Neredbojias <in*****@neredbojias.com> wrote:
And, btw, don't stir up that "mad hatter" crowd, a few of their
threads have (after a long absence) started appearing, complete
with foul language, on my newsreader.


I don't view them as a crowd, I view each as an individual with a unique
persona and responsible for his/her own commentary just as anyone would
be.


Boji, I have reinstructed Officer Bud White. Rather than give you
an education, I have told him to get one from you. I have told
him to accept on trust that you will treat him fairly on his
individual merit. In practical terms this means he will offer no
resistance and you can beat him into a pulp.


Nah, I wouldn't do that. Don't like to hurt people. Spanking young
women when they need it is as far as I go.
Casually categorizing people into groups leads to discrimination
which I have found that Australians in particular are far from free of.


Australians in particular eh? I take it that this categorization
is not casual.


He he, apparently you "got" the didactic anecdote (-er, joke.)

--
Neredbojias
Contrary to popular belief, it is believable.
Mar 19 '06 #17

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ron Provost | last post: by
1 post views Thread by Lam | last post: by
9 posts views Thread by ZikO | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.