2013/07/24 썸네일형 리스트형 JavaScript-특정 문자열이 JSON 인지 확인 / 파악하기 특정 문자열이 JSON 문자열 형식인지 파악하기 이것은 어떠한 데이터를 JSON Object 로 변환하기 전 확인할 때 사용할 수 있습니다. var response = false; try { response = jQuery.parseJSON('response from server'); } catch (error) { console.log("is not JSON type String or else); } if(respone && typeof response =='object') { //It is JSON } else { if(response === false || response == null) { //the response was a string "false", parseJSON will convert .. 이전 1 다음