I need a very basic, simple and lightweight AJAX script.
Does anyone have a shell of such a script they can share?
Here’s what I have:
- I have a PHP script on the server that echo’s the current date and time on the server
- I just need the javascript that calls the php script and loads the echoed text string into a js var so I can use it in my app
(the reason I need the server’s clock is that all visitors to the site have to work off the same clock. The app does not work for visitors outside the server’s timezone.)
Thanks for helping out.
JQuery is perhaps the right answer for AJAX but you can also do this in plain old Javascript as follows: