www.webdeveloper.com
Results 1 to 4 of 4

Thread: JSON object

  1. #1
    Join Date
    Feb 2011
    Posts
    23

    JSON object

    I'm pretty sure there is a really easy way to do this, but I can't seem to figure it out:

    How do I get JSON object from an outside webpage and convert it into a javascript object on my webpage to display an attribute. For example:
    I would like to parse the object located at https://maps.googleapis.com/maps/api...XrxfNPddCO4Xc4

    And simply print the name of the place (listed under "name" : ) using javascript.

    Thanks in advance,
    Alex

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,391

    Lightbulb

    See if post #10 is of any help to you
    in this thread: http://www.webdeveloper.com/forum/sh...d.php?t=262662

  3. #3
    Join Date
    Feb 2011
    Posts
    23
    Thanks for the reply.

    Quote Originally Posted by JMRKER View Post
    See if post #10 is of any help to you
    in this thread: http://www.webdeveloper.com/forum/sh...d.php?t=262662
    That post doesn't seem to explain how to make an object based on data on a seperate webpage, just how to construct an object from scratch.

    Google provides this little snippet of code:
    Code:
    for (i = 0; i < myJSONResult.results.length; i++) {
      myAddress[i] = myJSONResult.results[i].formatted_address;
    }
    and I'm just trying to figure out how to make make myJSONResult from the data at the provided URL (in my the first post).

    Thanks Again,
    Alex

  4. #4
    Join Date
    Jul 2012
    Posts
    2
    Thanks for the reply.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles