I'd like to get the server date and time using jQuery get method (from the same domain). I'd also like to do this without using any server-side scripting. How do I go about doing this?
Asked
Active
Viewed 4,544 times
1 Answers
1
Check how to read headers from AJAX request jQuery and AJAX response header
You can just read the date header, but without using a server-side page (aspx, php) the web server will cache files like .txt, .js or .css, and to overwrite that you can pass 'cache' as false to jQuery AJAX so it will append a random query parameter to force the web server to refresh it.
Note: You will need empty file(.js, .txt, ..) as the target of AJAX call

Community
- 1
- 1

Michael B.
- 2,798
- 1
- 14
- 18