从jquery帖子中获取价值 [英] Get value from jquery post

查看:69
本文介绍了从jquery帖子中获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数据$ .post我想得到id的值,



[对象{id = 1,firstname =aaa ,lastname =aaaaxxx,...}]



.done(函数(数据){

var html ='' ;



$ .each(数据,函数(索引,值){



console.log(价值);

});





});



我尝试了什么:



i尝试使用value.id但是没有用,请帮助

I have data $.post i want get value of id ,

[Object {id=1, firstname="aaa", lastname="aaaaxxx", ...}]

.done(function(data) {
var html = '';

$.each(data , function (index, value){

console.log(value);
});


});

What I have tried:

i have try value.id but not worked please help

推荐答案

.post我想得到id的值,



[对象{id = 1,firstname = aaa,lastname =aaaaxxx,...}]



.done(函数(数据){

var html = '';


.post i want get value of id ,

[Object {id=1, firstname="aaa", lastname="aaaaxxx", ...}]

.done(function(data) {
var html = '';


.each(数据,功能(索引,价值){



的console.log(值);

});





});



我尝试了什么:



i尝试使用value.id但是没有工作请求帮助
.each(data , function (index, value){

console.log(value);
});


});

What I have tried:

i have try value.id but not worked please help


我在这里采取疯狂的刺,但我认为你在说什么是



I am taking a wild stab here but I think what you are saying is

console.log(value); 





这给你输出这个





That gives you the output of this

[Object {id=1, firstname="aaa", lastname="aaaaxxx", ...}]





您想要访问该对象的ID。



鉴于我太懒了,无法弄清楚你的JSON是否结构正确,以及你的问题不清楚。我将假设您要访问



And you want to access the id of that object.

Given I am too lazy to figure out if your JSON is structured correctly, and the unclearness of your question. I'm going to assume that you want to access the Id value of

这篇关于从jquery帖子中获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆