Created
January 16, 2014 12:13
-
-
Save shenmao1989/8453965 to your computer and use it in GitHub Desktop.
服务器时间
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xhr = new XMLHttpRequest(); | |
if( !xhr ){ | |
xhr = new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
xhr.open("HEAD",location.href,true); | |
xhr.onreadystatechange=function(){ | |
if( xhr.readyState == 4 && xhr.status == 200 ){ | |
console.log(xhr.getResponseHeader("Date")); | |
} | |
} | |
xhr.send(null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment