Jump to content

[SOLVED] Display a ticker on a website...


savagenoob

Recommended Posts

I have little knowledge on AJAX but maybe have a use for it but want to make sure its possible. I am integrating a Timecard system on the site Im building and was wondering how easy/hard/possible it would be for AJAX to look at the last clock in on the database and display a count in hours and minutes of how long the employee has been clocked in/out. If it would be fairly easy/possible... please point in the right direction. Thank you.

Link to comment
Share on other sites

That should be fairly easy.  A couple AJAX tutorials and you should be fine.

 

 

Hints:

 

 

-Use setTimeout to call a function every second to increment the timer after getting the initial value from PHP.

-Return the seconds from PHP.  IE, instead of 3 hours, 10 minutes, 32 seconds, return 11432.  That will be easier to handle in JS.

-Use the function called by setTimeout to parse the seconds into human-usable format.

 

 

As for AJAX tutorials, just google "AJAX tutorials."  I would stick with well known sites though, like w3schools, or else you might come across some horrible coding.  I have a couple issues with the w3schools tutorial, but it should work fine.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.