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.