OnClick event question

J

J. Muenchbourg

I'm trying to have users play a sound file and view a popup page when
they click a link. Below is the script in the header, followed by the
example of the link after the body tag:

<script language="JavaScript">
<!------hide
function newwindow0()
{
window.open(popuppage.asp','jav','width=517,height=673,resizable=yes');
}//------->

</script>
[[[[
<a href="sound/mympeg.mp3" onClick="newwindow0();return
false">Sounds</a>

This does not do both events when clicked.

???
Muench
 
L

Lee

J. Muenchbourg said:
I'm trying to have users play a sound file and view a popup page when
they click a link. Below is the script in the header, followed by the
example of the link after the body tag:

<script language="JavaScript">
<!------hide
function newwindow0()
{
window.open(popuppage.asp','jav','width=517,height=673,resizable=yes');
}//------->

</script>
[[[[
<a href="sound/mympeg.mp3" onClick="newwindow0();return
false">Sounds</a>

This does not do both events when clicked.

By returning false from your onClick event handler, you're telling
the browser to ignore the contents of your href attribute.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top