PC Review Forums Newsgroups Microsoft Word Microsoft Frontpage Background Sound

Reply

Background Sound

 
Thread Tools Rate Thread
Old 28-07-2005, 05:39 PM   #1
=?Utf-8?B?UGV0ZQ==?=
Guest
 
Posts: n/a
Default Background Sound


I have added a background sound to my homepage only. So this plays whenever
the homepage is opened. Is it possible to configure this so it only plays
when the homepage is opened by a visitor for the first time & not everytime
you return to the homepage from other pages on the website ?
  Reply With Quote
Old 28-07-2005, 06:34 PM   #2
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Background Sound

You would need to look into writing a cookie.
http://en.wikipedia.org/wiki/HTTP_cookie
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

"Pete" <Pete@discussions.microsoft.com> wrote in message
news:613A76EE-E232-4DD0-834B-2632D31DC7AC@microsoft.com...
>I have added a background sound to my homepage only. So this plays whenever
> the homepage is opened. Is it possible to configure this so it only plays
> when the homepage is opened by a visitor for the first time & not everytime
> you return to the homepage from other pages on the website ?



  Reply With Quote
Old 29-07-2005, 02:25 AM   #3
Trevor L.
Guest
 
Posts: n/a
Default Re: Background Sound

Thomas,
I think the poster wants to have the music play only when anyone first
visits the home page in a session, and when coming back to the home page
from another page in the site, in that session, to have it *not* play. If
the person visits a second time - not from within the site - then the music
should still play.

Do I understand this correctly?
If so, does this necessarily need a cookie - wouldn't this prevent the music
from playing on the second and subsequent time of entering the home page ?

My thoughts are that when returning to the home page from another page, the
location is coded as index.html?revisit=yes and index.html then extracts the
parameter revisit and when yes, does not play the music.

As I have a similar situation, I will try this out. If I succeed, I will
post a response with the details.
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au

Thomas A. Rowe wrote:
> You would need to look into writing a cookie.
> http://en.wikipedia.org/wiki/HTTP_cookie
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "Pete" <Pete@discussions.microsoft.com> wrote in message
> news:613A76EE-E232-4DD0-834B-2632D31DC7AC@microsoft.com...
>> I have added a background sound to my homepage only. So this plays
>> whenever the homepage is opened. Is it possible to configure this so
>> it only plays when the homepage is opened by a visitor for the first
>> time & not everytime you return to the homepage from other pages on
>> the website ?



  Reply With Quote
Old 29-07-2005, 03:57 AM   #4
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Background Sound

This would be best done with a cookie that expires, in say 24 hours.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

"Trevor L." <tandcl@homemail.com.au> wrote in message
news:OZCVYT%23kFHA.3656@TK2MSFTNGP09.phx.gbl...
> Thomas,
> I think the poster wants to have the music play only when anyone first visits the home page in a
> session, and when coming back to the home page from another page in the site, in that session, to
> have it *not* play. If the person visits a second time - not from within the site - then the music
> should still play.
>
> Do I understand this correctly?
> If so, does this necessarily need a cookie - wouldn't this prevent the music from playing on the
> second and subsequent time of entering the home page ?
>
> My thoughts are that when returning to the home page from another page, the location is coded as
> index.html?revisit=yes and index.html then extracts the parameter revisit and when yes, does not
> play the music.
>
> As I have a similar situation, I will try this out. If I succeed, I will post a response with the
> details.
> --
> Cheers,
> Trevor L., WIP (Web Interested Person)
> Website: http://tandcl.homemail.com.au
>
> Thomas A. Rowe wrote:
>> You would need to look into writing a cookie.
>> http://en.wikipedia.org/wiki/HTTP_cookie
>> --
>> ==============================================
>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>> ==============================================
>> If you feel your current issue is a results of installing
>> a Service Pack or security update, please contact
>> Microsoft Product Support Services:
>> http://support.microsoft.com
>> If the problem can be shown to have been caused by a
>> security update, then there is usually no charge for the call.
>> ==============================================
>>
>> "Pete" <Pete@discussions.microsoft.com> wrote in message
>> news:613A76EE-E232-4DD0-834B-2632D31DC7AC@microsoft.com...
>>> I have added a background sound to my homepage only. So this plays
>>> whenever the homepage is opened. Is it possible to configure this so
>>> it only plays when the homepage is opened by a visitor for the first
>>> time & not everytime you return to the homepage from other pages on
>>> the website ?

>
>



  Reply With Quote
Old 29-07-2005, 08:13 AM   #5
Trevor L.
Guest
 
Posts: n/a
Default Re: Background Sound

Thomas,

I took your advice and tried to create a cookie as per
http://en.wikipedia.org/wiki/HTTP_cookie

I used this code:
<script type="text/javascript">
if (document.cookie)
{ document.cookie = "play=yes; expires=; path=/";
alert('cookie=' + document.cookie) }
else alert("cookie can't be set")
</script>

What returned was the alert
cookie can't be set

Why?
I am testing on my local disk. Should I test on the web?

I tried to set my website (tandcl.homemail.com.au) as an "Always Allow" in
IE Tools | Internet options | Privacy | Sites , but it didn't come up in the
list of sites. Again, I can't figure out why!

I am fairly sure I also allow cookies from primary sites, although where I
set this, I can't remember.

Any further help appreciated
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au

Thomas A. Rowe wrote:
> This would be best done with a cookie that expires, in say 24 hours.
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "Trevor L." <tandcl@homemail.com.au> wrote in message
> news:OZCVYT%23kFHA.3656@TK2MSFTNGP09.phx.gbl...
>> Thomas,
>> I think the poster wants to have the music play only when anyone
>> first visits the home page in a session, and when coming back to the
>> home page from another page in the site, in that session, to have it
>> *not* play. If the person visits a second time - not from within the
>> site - then the music should still play. Do I understand this correctly?
>> If so, does this necessarily need a cookie - wouldn't this prevent
>> the music from playing on the second and subsequent time of entering
>> the home page ? My thoughts are that when returning to the home page from
>> another
>> page, the location is coded as index.html?revisit=yes and index.html
>> then extracts the parameter revisit and when yes, does not play the
>> music. As I have a similar situation, I will try this out. If I succeed,
>> I
>> will post a response with the details.
>> --
>> Cheers,
>> Trevor L., WIP (Web Interested Person)
>> Website: http://tandcl.homemail.com.au
>>
>> Thomas A. Rowe wrote:
>>> You would need to look into writing a cookie.
>>> http://en.wikipedia.org/wiki/HTTP_cookie
>>> --
>>> ==============================================
>>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>>> ==============================================
>>> If you feel your current issue is a results of installing
>>> a Service Pack or security update, please contact
>>> Microsoft Product Support Services:
>>> http://support.microsoft.com
>>> If the problem can be shown to have been caused by a
>>> security update, then there is usually no charge for the call.
>>> ==============================================
>>>
>>> "Pete" <Pete@discussions.microsoft.com> wrote in message
>>> news:613A76EE-E232-4DD0-834B-2632D31DC7AC@microsoft.com...
>>>> I have added a background sound to my homepage only. So this plays
>>>> whenever the homepage is opened. Is it possible to configure this
>>>> so it only plays when the homepage is opened by a visitor for the
>>>> first time & not everytime you return to the homepage from other
>>>> pages on the website ?



  Reply With Quote
Old 29-07-2005, 12:14 PM   #6
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Background Sound

I would test it on the live site.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

"Trevor L." <tandcl@homemail.com.au> wrote in message news:ObqjiVBlFHA.3148@TK2MSFTNGP09.phx.gbl...
> Thomas,
>
> I took your advice and tried to create a cookie as per
> http://en.wikipedia.org/wiki/HTTP_cookie
>
> I used this code:
> <script type="text/javascript">
> if (document.cookie)
> { document.cookie = "play=yes; expires=; path=/";
> alert('cookie=' + document.cookie) }
> else alert("cookie can't be set")
> </script>
>
> What returned was the alert
> cookie can't be set
>
> Why?
> I am testing on my local disk. Should I test on the web?
>
> I tried to set my website (tandcl.homemail.com.au) as an "Always Allow" in IE Tools | Internet
> options | Privacy | Sites , but it didn't come up in the list of sites. Again, I can't figure out
> why!
>
> I am fairly sure I also allow cookies from primary sites, although where I set this, I can't
> remember.
>
> Any further help appreciated
> --
> Cheers,
> Trevor L., WIP (Web Interested Person)
> Website: http://tandcl.homemail.com.au
>
> Thomas A. Rowe wrote:
>> This would be best done with a cookie that expires, in say 24 hours.
>>
>> --
>> ==============================================
>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>> ==============================================
>> If you feel your current issue is a results of installing
>> a Service Pack or security update, please contact
>> Microsoft Product Support Services:
>> http://support.microsoft.com
>> If the problem can be shown to have been caused by a
>> security update, then there is usually no charge for the call.
>> ==============================================
>>
>> "Trevor L." <tandcl@homemail.com.au> wrote in message
>> news:OZCVYT%23kFHA.3656@TK2MSFTNGP09.phx.gbl...
>>> Thomas,
>>> I think the poster wants to have the music play only when anyone
>>> first visits the home page in a session, and when coming back to the
>>> home page from another page in the site, in that session, to have it
>>> *not* play. If the person visits a second time - not from within the
>>> site - then the music should still play. Do I understand this correctly?
>>> If so, does this necessarily need a cookie - wouldn't this prevent
>>> the music from playing on the second and subsequent time of entering
>>> the home page ? My thoughts are that when returning to the home page from another
>>> page, the location is coded as index.html?revisit=yes and index.html
>>> then extracts the parameter revisit and when yes, does not play the
>>> music. As I have a similar situation, I will try this out. If I succeed, I
>>> will post a response with the details.
>>> --
>>> Cheers,
>>> Trevor L., WIP (Web Interested Person)
>>> Website: http://tandcl.homemail.com.au
>>>
>>> Thomas A. Rowe wrote:
>>>> You would need to look into writing a cookie.
>>>> http://en.wikipedia.org/wiki/HTTP_cookie
>>>> --
>>>> ==============================================
>>>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>>>> ==============================================
>>>> If you feel your current issue is a results of installing
>>>> a Service Pack or security update, please contact
>>>> Microsoft Product Support Services:
>>>> http://support.microsoft.com
>>>> If the problem can be shown to have been caused by a
>>>> security update, then there is usually no charge for the call.
>>>> ==============================================
>>>>
>>>> "Pete" <Pete@discussions.microsoft.com> wrote in message
>>>> news:613A76EE-E232-4DD0-834B-2632D31DC7AC@microsoft.com...
>>>>> I have added a background sound to my homepage only. So this plays
>>>>> whenever the homepage is opened. Is it possible to configure this
>>>>> so it only plays when the homepage is opened by a visitor for the
>>>>> first time & not everytime you return to the homepage from other
>>>>> pages on the website ?

>
>



  Reply With Quote
Old 29-07-2005, 12:32 PM   #7
MikeR
Guest
 
Posts: n/a
Default Re: Background Sound

How about a session variable?
MikeR 1st

Pete wrote:
> I have added a background sound to my homepage only. So this plays whenever
> the homepage is opened. Is it possible to configure this so it only plays
> when the homepage is opened by a visitor for the first time & not everytime
> you return to the homepage from other pages on the website ?

  Reply With Quote
Old 29-07-2005, 01:11 PM   #8
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Background Sound

But then all pages would have be .asp, if ASP is the server-side scripting language supported on the
server in order to maintain the session state.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

"MikeR" <NOnf4lSPAM@pobox.com> wrote in message news:%23vB0OmDlFHA.3960@TK2MSFTNGP12.phx.gbl...
> How about a session variable?
> MikeR 1st
>
> Pete wrote:
>> I have added a background sound to my homepage only. So this plays whenever the homepage is
>> opened. Is it possible to configure this so it only plays when the homepage is opened by a
>> visitor for the first time & not everytime you return to the homepage from other pages on the
>> website ?



  Reply With Quote
Old 30-07-2005, 10:57 AM   #9
MikeR
Guest
 
Posts: n/a
Default Re: Background Sound

True.
MikeR 1st

Thomas A. Rowe wrote:
> But then all pages would have be .asp, if ASP is the server-side scripting language supported on the
> server in order to maintain the session state.
>

  Reply With Quote
Old 04-08-2005, 05:51 AM   #10
Trevor L.
Guest
 
Posts: n/a
Default Re: Background Sound

Thomas,

I have at last tried this on the live site

My code is
function createCookie(name, value, days)
{
if (days)
{ var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
}
else var expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
//-------------------------------
function readCookie(name)
{
var ca = document.cookie.split(';');
var nameEQ = name + "=";
for(var i=0; i < ca.length; i++)
{ var c = ca[i];
while (c.charAt(0)==' ')
c = c.substring(1, c.length); //delete spaces
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length, c.length);
}
return null;
}
//-------------------------------
function playmusic()
{
document.write(
'<tr id="music"><th>'
+ ' <input type="button" class="top" value="Hide Player"'
+ ' onclick="hideit(\'music\')";>'
+ ' <embed src="minuet.mid" id="theNoise"'
+ ' width="144" height="45" autostart="true" loop="false">'
+ '</th></tr>')
}

<script type="text/javascript">
if (readCookie('play') != 'no')
playmusic()
createcookie('play','no','0.0417')
</script>

The music plays fine very time, even after exiting the page to another page
in the same website and then returning or refreshing the page entirely

Any ideas?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

Thomas A. Rowe wrote:
> I would test it on the live site.
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "Trevor L." <tandcl@homemail.com.au> wrote in message
> news:ObqjiVBlFHA.3148@TK2MSFTNGP09.phx.gbl...
>> Thomas,
>>
>> I took your advice and tried to create a cookie as per
>> http://en.wikipedia.org/wiki/HTTP_cookie
>>
>> I used this code:
>> <script type="text/javascript">
>> if (document.cookie)
>> { document.cookie = "play=yes; expires=; path=/";
>> alert('cookie=' + document.cookie) }
>> else alert("cookie can't be set")
>> </script>
>>
>> What returned was the alert
>> cookie can't be set
>>
>> Why?
>> I am testing on my local disk. Should I test on the web?
>>
>> I tried to set my website (tandcl.homemail.com.au) as an "Always
>> Allow" in IE Tools | Internet options | Privacy | Sites , but it
>> didn't come up in the list of sites. Again, I can't figure out why!
>>
>> I am fairly sure I also allow cookies from primary sites, although
>> where I set this, I can't remember.
>>
>> Any further help appreciated
>> --
>> Cheers,
>> Trevor L., WIP (Web Interested Person)
>> Website: http://tandcl.homemail.com.au
>>
>> Thomas A. Rowe wrote:
>>> This would be best done with a cookie that expires, in say 24 hours.
>>>
>>> --
>>> ==============================================
>>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>>> ==============================================
>>> If you feel your current issue is a results of installing
>>> a Service Pack or security update, please contact
>>> Microsoft Product Support Services:
>>> http://support.microsoft.com
>>> If the problem can be shown to have been caused by a
>>> security update, then there is usually no charge for the call.
>>> ==============================================
>>>
>>> "Trevor L." <tandcl@homemail.com.au> wrote in message
>>> news:OZCVYT%23kFHA.3656@TK2MSFTNGP09.phx.gbl...
>>>> Thomas,
>>>> I think the poster wants to have the music play only when anyone
>>>> first visits the home page in a session, and when coming back to
>>>> the home page from another page in the site, in that session, to have
>>>> it *not* play. If the person visits a second time - not from
>>>> within the site - then the music should still play. Do I understand
>>>> this
>>>> correctly? If so, does this necessarily need a cookie - wouldn't this
>>>> prevent
>>>> the music from playing on the second and subsequent time of
>>>> entering the home page ? My thoughts are that when returning to the
>>>> home
>>>> page from another page, the location is coded as
>>>> index.html?revisit=yes and index.html then extracts the parameter
>>>> revisit and when yes, does not play the
>>>> music. As I have a similar situation, I will try this out. If I
>>>> succeed, I will post a response with the details.
>>>> --
>>>> Cheers,
>>>> Trevor L., WIP (Web Interested Person)
>>>> Website: http://tandcl.homemail.com.au
>>>>
>>>> Thomas A. Rowe wrote:
>>>>> You would need to look into writing a cookie.
>>>>> http://en.wikipedia.org/wiki/HTTP_cookie
>>>>> --
>>>>> ==============================================
>>>>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>>>>> ==============================================
>>>>> If you feel your current issue is a results of installing
>>>>> a Service Pack or security update, please contact
>>>>> Microsoft Product Support Services:
>>>>> http://support.microsoft.com
>>>>> If the problem can be shown to have been caused by a
>>>>> security update, then there is usually no charge for the call.
>>>>> ==============================================
>>>>>
>>>>> "Pete" <Pete@discussions.microsoft.com> wrote in message
>>>>> news:613A76EE-E232-4DD0-834B-2632D31DC7AC@microsoft.com...
>>>>>> I have added a background sound to my homepage only. So this
>>>>>> plays whenever the homepage is opened. Is it possible to
>>>>>> configure this so it only plays when the homepage is opened by a
>>>>>> visitor for the first time & not everytime you return to the
>>>>>> homepage from other pages on the website ?



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off