savagenoob Posted January 16, 2009 Share Posted January 16, 2009 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. Quote Link to comment Share on other sites More sharing options...
corbin Posted January 16, 2009 Share Posted January 16, 2009 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. Quote Link to comment Share on other sites More sharing options...
savagenoob Posted January 16, 2009 Author Share Posted January 16, 2009 sweet... thanks Corbin. you da man. Now for Higher Learning. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.