这是我的json:
{"d":{"key1":"value1",
"key2":"value2"}}
Run Code Online (Sandbox Code Playgroud)
有没有办法在不知道键是什么的情况下访问此数组中的键和值(在javascript中)?
我的json结构的原因是我通过jquery调用的web方法返回一个字典.如果无法使用上述内容,我需要更改有关返回数据的方式吗?
这是我的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
Run Code Online (Sandbox Code Playgroud)