Adding sound into a web page- JavaScript tip

you can play music on your personal web site.

The code very simple you have to just palce it in body section of your HTML document.

How to use an <EMBED> tag:

<EMBED SRC=Sound_file.mid autostart="true"  WIDTH="144"  HEIGHT="60" LOOP=1>

 LOOP=2 will tells browser how many times to play sound.

IF  the visitor are using browsers that do not support the embedded sound. then do this in that case on that page:

<embed src="Sound_file.mid" hidden="true" autostart="true" loop="1">
<noembed>Your browser doesn't support EMBED, but you can still listen to the background sound of this page by<a href="Sound_file.mid "> clicking here.</a></noembed>

Using bgsound Tag

This tip explains how sound or music can be played when a visitor passes the mouse pointer over an image.

Note: This tip will work only in Internet Explorer.

<bgsound src="#" id="songs" autostart="true">

<img src="nameofimage.gif" width="100" height="106" border="0"
onmouseover="document.all.songs.src='Sound_file.mid' ">
Tags: , ,

Join Us!