以下是我的json:
{"d":{"key1":"value1",
"key2":"value2"}}
是否有任何方法可以在不知道键是什么的情况下访问该数组中的键和值(在javascript中)?
我的json是这样 struct 的原因是我通过jquery调用的webmethod返回了一个字典.如果无法使用上述方法,我需要改变返回数据的方式吗?
以下是我的webmethod的概要:
<WebMethod()> _
Public Function Foo(ByVal Input As String) As Dictionary(Of String, String)
Dim Results As New Dictionary(Of String, String)
'code that does stuff
Results.Add(key,value)
Return Results
End Function