foreach for JSON array , syntax

前端 未结 4 614
夕颜
夕颜 2021-01-30 12:34

my script is getting some array from php server side script.

result = jQuery.parseJSON(result);

now I want to check each variable of the array.

4条回答
  •  天涯浪人
    2021-01-30 13:02

    Sure, you can use JS's foreach.

    for (var k in result) {
      something(result[k])
    }
    

提交回复
热议问题