M
Marc
I'm aware that there are significant differences between VBScript objects
and JScript objects but that doesn't mean something like the following
should give me such troubles?
<%@ Language=VBScript %>
<script language="jscript" runat="server">
var json = {"widget":[{"value":"text here"},{"value":123}]};
</script>
<%
Response.Write json.widget & "<br />"
For Each o In json.widget
Response.Write o.value & "<br />"
Next
Response.Write "IsArray: " & IsArray(json.widget) & "<br />"
Response.Write "IsObject: " & IsObject(json.widget) & "<br />"
Response.Write json.widget(0).value '<- won't work...?
%>
The above code return the following results:
[object Object],[object Object]
text here
123
IsArray: False
IsObject: True
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'widget'
/asp/json.asp, line 16
Anyone an idea how to get the dot notation:
json.widget(0).value
to work?
and JScript objects but that doesn't mean something like the following
should give me such troubles?
<%@ Language=VBScript %>
<script language="jscript" runat="server">
var json = {"widget":[{"value":"text here"},{"value":123}]};
</script>
<%
Response.Write json.widget & "<br />"
For Each o In json.widget
Response.Write o.value & "<br />"
Next
Response.Write "IsArray: " & IsArray(json.widget) & "<br />"
Response.Write "IsObject: " & IsObject(json.widget) & "<br />"
Response.Write json.widget(0).value '<- won't work...?
%>
The above code return the following results:
[object Object],[object Object]
text here
123
IsArray: False
IsObject: True
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'widget'
/asp/json.asp, line 16
Anyone an idea how to get the dot notation:
json.widget(0).value
to work?