Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2004, 11:31 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default audio onLoad

questions
I have a piece of audio on the main page that plays once when the page loads for the first time, I dont want it to play when my user visits other pages on the site and returns back to my home page either with the back button or with navigation links on the secondary pages. Is there a piece of script I can steal that will allow this,, cookies are always nice things you should share.

Thanks in advance
Larson

I think.....therefore..I code
__________________
I think.....therefore..I code
 
Old February 20th, 2004, 06:47 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well as you say cookies would be a solution. Write one when the suer vists the first time and check on each vist to see if they have visited within the past hour/day/week as you think fit. The only reliable way to do it though would be to have a session variable using server side code such as asp that recorded there first visit to the page and then prevented the audio being played.
As a personal preference I can't stand sites that play music spontaneously on arrival but I'm sure it's acceptable in some cases.

--

Joe
 
Old February 21st, 2004, 12:39 AM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the advice, my site is used for the specific purpose of audio, I am a producer, and the site is used to showcase my talents as an audio imaging/commercial production producer. I appreciate your feedback though. Thanks for your reply

Larson

I think.....therefore..I code





Similar Threads
Thread Thread Starter Forum Replies Last Post
Onload with AJAX Baco Intro Programming 0 June 11th, 2007 12:46 PM
onLoad functionality NEO1976 Javascript 0 May 23rd, 2006 09:38 AM
iframe onLoad darkhalf Javascript 1 January 11th, 2006 04:42 PM
two script onLoad mateenmohd Javascript 2 December 28th, 2003 12:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.