This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Retrieve values from json in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Retrieve values from json in javascript " Watch "Retrieve values from json in javascript " New topic
Author

Retrieve values from json in javascript

pravin rasal
Ranch Hand

Joined: Jul 27, 2011
Posts: 63
How to get the values from JSON in javascript following is my code

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
Objects do not have a length. You need a for in loop.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63352
    
  70

Is that really how you indent your code?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17276
    
    6

Bear Bibeault wrote:Is that really how you indent your code?


I think it is a copy paste thing. I have had stuff like that happen. Where it is perfectly indented in my IDE, then I copy and paste the code here, or elsewhere in my code and there ends up being more indentention than in the actual code.

Mark


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63352
    
  70

Using tabs for indentation, perhaps? I always use spaces -- makes the code look as intended everywhere.

And even so, making the code easy to read helps posters get help. So it's worth any extra time it takes to make sure that posted code has proper indentation that makes the code easy to read.

Hard-to-read-code == moving on to next post with easier-to-read code.
pravin rasal
Ranch Hand

Joined: Jul 27, 2011
Posts: 63
Thank you so much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieve values from json in javascript
 
It's not a secret anymore!