SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $.getJSON return array object has special characters

    Hello everyone,

    My coding returns the json array and the object has special characters which i am not able to retrieve the data in my coding.

    Example:
    {
    "No.":"3",
    "sign":"positive",
    "nr_old":"",
    "referring domain or url":"www.google.co.za",
    "visits":"1",
    "avg. pv/ v":"4.0",
    "graph":""
    }

    In the above example, i am not able to retrieve "No." and "referring domain or url" and "avg. pv/ v"

  2. #2
    SitePoint Member
    Join Date
    Jun 2011
    Location
    Surrey, UK
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    JSON={
    "No.":"3",
    "sign":"positive",
    "nr_old":"",
    "referring domain or url":"www.google.co.za",
    "visits":"1",
    "avg. pv/ v":"4.0",
    "graph":""
    }
    
    console.log(JSON["No."]);
    This works, but of course it would be better to get the returned JSON object changed to something more manageable if at all possible.

  3. #3
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My Goodness. It is just that simple. Thanks a lot guys. I am a core PHP developer and I have been breaking my head. And thanks for the solution. It worked....


Tags for this Thread

Bookmarks

Posting Permissions

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