JavaScript How to navigate JSON Object in jQuery? navigate json object javascript,navigate json object,navigate json object

I made this webservice that handles my database functions, and this is an AJAX call to one of the methods.

 $.ajax({
        type: "POST",
        url: "Service/dataBaseService.asmx/getRMAData",
        data: '{"RMAId": 1 }',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        async: true,
        cache: false,
        success: function (data) {
            console.log(data);
            alert(data.RMA_ID);
        }
  });

this is what is logged:

({d:"[{\"RMA_ID\":1,\"RequestDate\":\"2013-02-28T00:00:00\",\"Company\":1,\"Status\":\"Accepted            \",\"Serial\":201764,\"LastChangeDate\":\"2013-02-28T00:00:00\",\"LastChangeBy\":\"Foreign    \",\"Price\":null}]"})

However alert(data.RMA_ID) returns undefined aswell as data.d.RMA_ID?

How can I get hold of the values?

Answer:1

The value of data that you've logged is an object with a property named d, that contains a string value. You could probably make adjustments at your server side to make the value of d an object rather than a string, but the way it is currently constructed, you would be able to parse it into an object using JSON.parse.

Once you've done that, the resulting object should be an array, containing one single object. Thus, your access to RMA_ID would be as follows:

var data = JSON.parse(data.d);
alert(data[0].RMA_ID);
Answer:2

I would like to know if it's possible to recreate the tile system of modern UI from Windows 8 on a HTML page. I already created this from this website. Here is the code <div class="tile pos1-1 ...

I would like to know if it's possible to recreate the tile system of modern UI from Windows 8 on a HTML page. I already created this from this website. Here is the code <div class="tile pos1-1 ...

I understand that you need to use ".on" to use code that you loaded with jquery after the page has loaded. (At least I think it works that way) So I tried that but it somehow just doesn't do a thing ...

I understand that you need to use ".on" to use code that you loaded with jquery after the page has loaded. (At least I think it works that way) So I tried that but it somehow just doesn't do a thing ...

  1. cant select plane game recipe

I got two browser windows on the same domain, one is the main window and the second is small popup window. i found this: How to Communicate between two browser windows? but, the problem is the ...

I got two browser windows on the same domain, one is the main window and the second is small popup window. i found this: How to Communicate between two browser windows? but, the problem is the ...

  1. communicate between popup window
  2. communicate with popup window
  3. javascript communicate between popup
  4. chrome extension communicate between popup and background

I have used SelectBoxIt plugin to display the select boxes in my application. I have two select boxes, if I change the value in first select box, another should automatically update (it should ...

I have used SelectBoxIt plugin to display the select boxes in my application. I have two select boxes, if I change the value in first select box, another should automatically update (it should ...