Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:31:17+00:00 2026-06-14T16:31:17+00:00

I am doing a winJS.xhr like this : var jsonResult; WinJS.xhr( { url: urlGoogle,

  • 0

I am doing a winJS.xhr like this :

var jsonResult;
WinJS.xhr(
{
    url: urlGoogle,
    responseType: 'json'
}
).done(function complete(response) {
    jsonResult = response.responseText;

    console.log(jsonResult);
}, 
//Error and Progress functions
);

The console log shows me this :

{lhs: "32 Japanese yen",rhs: "0.30613818 Euros",error: "",icc: true}

And I want to get the rhs info.
So I tried doing

console.log(jsonResult.rhs); 

and

console.log(jsonResult['rhs']);

It only shows me “undefined”. Then I realized that when I did a jsonResult[0], it shows me the first character (which is { ) and so on with the index bracket.

I tried to do a JSON.parse(jsonResult); but it creates an error

json parse unexpected character
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:31:18+00:00Added an answer on June 14, 2026 at 4:31 pm
    var test = {lhs: "32 Japanese yen",rhs: "0.30613818 Euros",error: "",icc: true}
    //test.lhs returns "32 Japanese yen"
    

    I am not quite sure why this isn’t working for you. Try logging the console.log(typeof jsonResult) to see if the jsonResult is a string or a object. (if it were a string, I’d say JSON.parse should’ve worked)
    Then log jsonResult itself, and see if you can walk through it’s properties.
    (The google chrome console works like a charm for this)

    In case it is a string, this is a (Somewhat hacky, unsafe) way to do it:

    var result = eval('({lhs: "32 Japanese yen",rhs: "0.30613818 Euros",error: "",icc: true})')
    var result = eval('(' + jsonResult + ')')
    

    (Thanks to @ThiefMaster♦ for some more proper(-ish) use of eval instead of my own abuse of it.)
    You should then be able to access result
    Generally, you don’t want to use eval, but if all else fails…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Doing this: @resp = Net::HTTP.get_response(api.something.com, /feed/v1/offers.json?#{@params_api_string}) I get this response in @resp: #<Net::HTTPOK:0x7f451e9d3ef0> How
Doing following in jQuery: $('#signupbox1').on('click', '#signup1', function() { var str = $('#signupform').serialize(); // make
Doing the getting started of Sinatra. I get this error: ./sinatra.rb:5: undefined method `get'
Doing this works in IE7: <a href= target=_blank>Link</a> But in IE8 it open a
Doing a code review I've stumbled over GWM in Java-Spring-GWT web-application. As this product
I am querying an HTML file with LINQ-to-XML. It looks something like this: <html>
my main concern is if i am doing this safely, efficiently, and for the
I'm a beginner in sql and I am doing this through a php document.
Doing some work in javascript I have a multidimensional made up in this format
Ok so I need a bit of help. This is what im doing so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.