简体   繁体   English

将数组中的值存储到jquery中的变量中

[英]store the value from an array into variable in jquery

https://i.stack.imgur.com/RtzeT.png

I get these type of array in my jQuery variable. 我在jQuery变量中得到了这些类型的数组。 Now I want store each array values in differnt varaible. 现在,我想将每个数组值存储在不同的变量中。 (Ex : I want to store Address field in one variable). (例如:我想将“ Address字段存储在一个变量中)。 How to do it? 怎么做? Any suggestion? 有什么建议吗? Here I upload the image, I get that type of array in console. 在这里,我上传图像,然后在控制台中获得该类型的数组。

 $.ajax({
                type : 'POST',
                url  : '<?php echo MY_SITE_URL ;?>'+'webapi.php',
                data: { task:'Properties.getSearch',SEARCHID1: SEARCHID1},
                success: function(response)
                {
                     var j= JSON.parse(response);
                     console.log(j);
                }, 

        });

You can create variable with get each data into your json . 您可以使用将每个数据放入json来创建变量。

var Address = j.Address;
var Status = j.status;
etc...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM