Jump to content
MakeWebGames

Time Stamp


unknown123
 Share

Recommended Posts

Hi

I got some numbers in my database and i want to use a time stamp to display each number every 10 seconds to the browser.

This is for a online cricket management I am making and all the scores have already been calculated and stored in the database and I need to display a ball every 10 seconds to make it look like the game is actually being played live.

1) How would i go about doing this?

2) Other better ways of making this happen or is time stamp the best way to acheive this?

Thanks in advance

Link to comment
Share on other sites

Re: Time Stamp

The simple answer is you need to have the user's browser request a page every ten seconds.

Anything the user sees or does all begins with them. In order to get something to the user every ten seconds, they have to request it every ten seconds.

Normally, this is achieved using a javascript timeout loop.

Here's a link to a page that shows how to set up such a loop. -> http://www.w3schools.com/js/js_timing.asp

Now, there's basically three ways to exploit this. Have the loop refresh the entire page, refresh and iframe/frame, or load an ajax request.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...