如何遍历json对象?其实方法很简单。
比如有如下json对象:
var obj ={“name”:”张三”,”password”:”123456″,”department”:”技术部”,”sex”:”女”,”old”:30};
遍历方法:

var arr = eval('(' + obj + ')');
for(var p in arr){
     str = str+arr[p]['字段名']+','; //如str = str + arr[p]['name'] + ',';
     return str;
}

53 Comments

  1. After examine just a few of the weblog posts in your website now, and I truly like your means of blogging. I bookmarked it to my bookmark website listing and can be checking back soon. Pls take a look at my web site as effectively and let me know what you think.

  2. Nice post. I be taught one thing more difficult on totally different blogs everyday. It can all the time be stimulating to read content from different writers and practice slightly one thing from their store. I’d prefer to use some with the content on my weblog whether or not you don’t mind. Natually I’ll give you a hyperlink on your internet blog. Thanks for sharing.

  3. Good-bye my love, hello my also pen-friend
    This isn’t a origin but is it unquestionably the end?
    I won’t forget all that we have been through
    I even-handed don’t separate if I thing embrace you or have an aversion to you

  4. I just wanted to comment and say that I really enjoyed reading your blog post here. It was very informative and I also digg the way you write! Keep it up and I’ll be back to read more in the future

  5. I’d be inclined to recognize with you one this subject. Which is not something I typically do! I enjoy reading a post that will make people think. Also, thanks for allowing me to speak my mind!

  6. An impressive share, I just given this onto a colleague who was doing somewhat analysis on this. And he in reality bought me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading extra on this topic. If attainable, as you change into expertise, would you mind updating your weblog with more details? It is highly helpful for me. Massive thumb up for this blog post!

  7. The first thing I have noticed is it’s really look like a two and a half men story!
    Hey, I’m just wondering, the post is so cool, but there are no interesting comments conserning this topic!
    I’ll advice that to my friends and I hope they will like it.

  8. Thank you sharing these kinds of wonderful posts. In addition, an excellent travel and also medical insurance approach can often eliminate those issues that come with traveling abroad. A medical emergency can rapidly become costly and that’s bound to quickly decide to put a financial load on the family’s finances. Having in place the best travel insurance package prior to leaving is well worth the time and effort. Thanks a lot

发表评论

电子邮件地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


*