asp에서 json 파일 호출하여 파싱. 테이블로 보여주기
제목 : asp에서 json 파일 호출하여 파싱. 테이블로 보여주기
소스 :
Dim url : url = "http://localhost:9011/json_test/order.asp"
Dim param : param = ""
Dim objHttp
Dim strJsonText
Set objHttp = server.CreateObject("Microsoft.XMLHTTP")
If IsNull(objHttp) Then
Response.Write "서버 연결 오류. 관리자 문의바랍니다."
Response.End
End If
objHttp.Open "Get", url, False
objHttp.SetRequestHeader "Content-Type","text/plain"
objHttp.Send param
strJsonText = objHttp.responseText ' 결과데이터 파서로 넘기기 위해 별도 저장
Set objHttp = Nothing '개체 소멸
'-------------------------------------------
Dim cheering: Set cheering = JSON.parse(strJsonText)
Dim rList
If IsNull(cheering) then
Response.Write "Json Parsing Error<br/>"
Response.End
End If
내용 : 원격 url 의 json 내용을 Microsoft.XMLHTTP 로 내용을 가져와서, 파싱하여 보여주기.
압축파일 내용
json 예제 파일.
파싱 파일.
JSON2.min.asp 파일
예제 소스 파일 :asp_json_sample.zip
출처 : 직접 생산 ^^;;