How to read json response as name value pairs in JQuery

前端 未结 3 1177
情书的邮戳
情书的邮戳 2020-12-16 05:20

I want to read json response as name and value pairs in my JQuery code. Here is my sample JSON response that I return from my java code:

String jsonResponse          


        
3条回答
  •  既然无缘
    2020-12-16 05:41

    It's easy like this:

    json = {"key1": "value1", "key2": "value2" };
    
    $.each(json, function(key, value) { alert(key + "=" + value); });

提交回复
热议问题