locked
Parse XHR data

    Question

  • Hi, i was wondering if there were any good resources people knew of that help with writing the WinJS.xhr functions. I have mine working to a point. I'm able to POST and GET data from my MySQL database. I don't know how to parse the data. 

    With this code:

    WinJS.xhr({
                    url: "http://url",
                    type: "get",
                    headers: { "Content-type": "application/x-www-form-urlencoded" },
                })
                    .done(function complete(result) {
                        xhrDiv5.innerText = JSON.stringify(result.response); 


    I get this:

    "{\"Id\":1,\"Name\":\"Tomato Soup\",\"Category\":\"Groceries\",\"Price\":1.39}"
    I want to be able to parse through the data, but don't know how. 

    Thanks!




    • Edited by ZachAtttack Tuesday, July 9, 2013 3:54 PM c
    Monday, July 8, 2013 12:53 PM

Answers