Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Archives
Today
Total
관리 메뉴

유령노트

ajax로 서버 시간 가져오기 본문

# Dev/Jquery

ajax로 서버 시간 가져오기

유령손 2017. 2. 10. 11:29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$(function () {
    $.ajax({
        type: 'GET',
        cache: false,
        url: location.href,
        complete: function (req, textStatus) {
            var dateString = req.getResponseHeader('Date');
            if (dateString.indexOf('GMT'=== -1) {
                dateString += ' GMT';
            }
            var date = new Date(dateString);
            $('#serverTime').text(date.toString());
        }
    });
});
cs

'# Dev > Jquery' 카테고리의 다른 글

JQGrid  (0) 2017.02.03
DIV 크기가 0으로 고정이 되고 바뀌지 않을 때  (0) 2017.01.09
JQGrid(제이큐그리드) 리로드 시키기  (0) 2016.12.22
라디오 박스 세팅  (0) 2016.12.20