PDA

View Full Version : OnClick Script


JeStEr
10-11-2002, 03:42 AM
Does anybody know an OnClick Javascript that when a link is clicked on it plays a sound and then links to a webpage. The script has to be able to work in all versions of IE, NN and any other web browsers and also on all operating systems Windows etc.

chrismiceli
10-11-2002, 03:58 AM
well nothing could work in all versions of ie and ns because javascript wasn't put in them until i think version 3 or 4. You could do somehting like this, but this is just a guess


<html>
<head>
<title>test</title>
</head>
<body>
<script language="javascript">
function hello() {
document.embname.play = true; //i think it might only work with autoplay = true
}
</script>
<a href="www.google.com" onClick="hell()">
<embed src="sound.wav" name="embname" autoplay="false" loop="false" height="0">
</body>
</html>