Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7967363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:40:33+00:00 2026-06-04T06:40:33+00:00

I am making ajax request to a particular server and getting the response also.

  • 0

I am making ajax request to a particular server and getting the response also. I am doing cross domain request so using jsonp. Is there a way to get the server time to which i am making the request. Will it be better to write php script or doing just ajax request is good. Suppose if i make the following request :

$.ajax({
        dataType: 'jsonp',
        data: 'jsonp=date',
        jsonp: 'jsonp_callback',                
        url: 'http://www.google.com',   
        success: function (data) {                  
        }
});

How can i get the server time from this request? Please help if any suggestion. Also after getting the time if i use setInterval method to update time every second will it be a costly operation or better to make the same ajax request after a particular time to update time. I have real time data to update with the time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:40:35+00:00Added an answer on June 4, 2026 at 6:40 am

    You can’t get the server’s time if it doesn’t explicitly provide it to you.
    You can read its HTTP headers, but that’s not a good thing since the headers may not provide this information every time, or their format may not be the same all the time.

    Also, I don’t see the point of asking it every second.
    Ask it one single time, calculate the difference between its time and yours, and here you go: you got the difference of time and you can use it wherever you want.

    Keep in mind that even if you get the time, there probably will be a difference between the one you got and the server’s real time because of the network’s latency.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an ajax request and storing my response in an hidden field.I'm doing
I am making an ajax request using JQuery that looks like this: var data
I'm following this tutorial about making an Ajax request on Rails: http://net.tutsplus.com/tutorials/javascript-ajax/using-unobtrusive-javascript-and-ajax-with-rails-3/ made _form
I am making an ajax request using Jquery and everything works fine except the
I am making an AJAX request for XML. I am doing this every second.
I am using prototype.js for making Ajax request. Everything was working fine till I
On my page I'm making ajax-request to get data from server. The data is
i am making a ajax request using $.get as soon as the user types
I am making an ajax request from a jquery script to one of my
I am making an ajax request to my servlet and the servelt responds with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.