반응형
$.ajax({
type:"GET",
url:"info.json",
dataType : "JSONP",
jsonpCallback : "info",
success: function(xml){
console.log(xml);
},
error: function(xhr, status, error) {
//alert(error);
console.log(error);
}  
});



jquery 선언하시고


json 데이터는 아래와 같은 형식으로  info 는 맞춰주고


info({"month":"2","hours":"2","day":"8","year":"2019","min":"46","second":"44"})


728x90
반응형

'web > javascript & jquery' 카테고리의 다른 글

슬라이딩 메뉴 , 드롭다운메뉴  (0) 2019.12.24
간단 GNB html  (0) 2019.12.19
iframe 높이 계산  (0) 2019.02.08
jquery - ajax  (0) 2019.02.01
javascript underscore 언더스코어 정리  (0) 2018.08.08

+ Recent posts