CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2014
    Posts
    2

    Changing text on a web page randomly after 24 hour time frame

    Hi
    I think this is JavaScript code i need.

    I am making a prediction web site it works on the basis that a person picks a number from a number grid and that takes them to the relevant numbers page.This page shows the prediction in text.

    what i would like to do is have the prediction text change after say 48hours automatically to another different prediction text but on the same page and relevant to the same number ..so one day a person picks say .. number 1 and they get the word "hello"then they click on number one again 48hours later and get the word "goodbye". so the text is constantly changing every 48hours to something completely new.

    please help i am a JavaScript rookie.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Changing text on a web page randomly after 24 hour time frame

    In order for you to change every 48 hours, you would need to store timestamp data in a cookie and access it upon visiting to check relevant time.

    How much do you have done already?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jun 2014
    Posts
    2

    Re: Changing text on a web page randomly after 24 hour time frame

    I have done nothing so far just trying to see a script that I can at least learn from,its so frustrating.
    Thanks for replying PA .

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Changing text on a web page randomly after 24 hour time frame

    This isn't going to just be a simple job. I would suggest going through the simple JavaScript tutorial from W3Schools.

    http://www.w3schools.com/js/default.asp

    Focus on the cookies and DOM for what you need.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured