foreach for JSON array , syntax

前端 未结 4 669
夕颜
夕颜 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 12:55

    Try this:

    $.each(result,function(index, value){
        console.log('My array has at position ' + index + ', this value: ' + value);
    });
    

提交回复
热议问题