PC Review
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
Background Sound
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
Background Sound
![]() |
Background Sound |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 ? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 ? |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 ? |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 ? > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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 ? |
|
|
|
#6 |
|
Guest
Posts: n/a
|
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 ? > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
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 ? |
|
|
|
#8 |
|
Guest
Posts: n/a
|
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 ? |
|
|
|
#9 |
|
Guest
Posts: n/a
|
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. > |
|
|
|
#10 |
|
Guest
Posts: n/a
|
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 ? |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

