Output JSON

https://code.google.com/archive/p/aspjson/

'on error resume next
Dim res 
Set res = jsObject()
set hero = new Hero_m

user_id = session("userNo")
if isNull(user_id) or cLng(user_id) = 0 then
	fail_response "請先登入"
end if

hero_current = hero.user_points(user_id)
if hero_current < 10 then
	fail_response "點數不足"
end if

success_response hero_current


sub fail_response(message)
	res("status") = "fail" 
	res("message") = message
	res.Flush
	response.end
end sub

sub success_response(data)
	res("status") = "success" 
	res("data") = data
	res.Flush
	response.end
end sub