By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,235 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,235 IT Pros & Developers. It's quick & easy.

sound before entering site

100+
P: 152
Hello,

I would like some guidance on how to play a sound before the page is loaded on the browser.

Thanks
May 21 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
You can't play sound using JavaScript, i.e. JavaScript doesn't have native sound support, but you can use helper objects, e.g. the object tag to include an application such as RealPlayer, Windows Media Player, Quicktime, etc.
May 21 '09 #2

100+
P: 152
Yes i know that....

What i want is something like a javascript that first plays a sound and then the page is loaded in the browser... i know how to add sound in my page... however that sound must be played before the page is loaded or shown on the browser..
May 21 '09 #3

acoder
Expert Mod 15k+
P: 16,027
If you can be sure everyone will have JavaScript enabled, you can keep the output/display hidden initially and then play the file. Once it's complete, set the display property of the page container to "block", or if you've just hidden it, the visibility property to "visible".
May 21 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.