Skip to content Skip to sidebar Skip to footer

How Can I Access The Properties Of My Json Object Using Jquery In This Jsfiddle?

Yeah I've been vaguely trying to use this questions example to test something out with jsfiddle. I'm looking to build a JQuery sortable widget, but first I need to find out how I c

Solution 1:

You need to parse the JSON string into an object:

functionshow_response(data) {
    data = $.parseJSON(data);
    $.each(data, function(position, value)
    {        
       alert(value.name);
    };

EDIT: Your fiddle has syntax errors. The JSON is not created as there is no toJSON method in jQuery. In order to read your categories using an each iterator, they need to be an array like:

categories = [name: "Book", value: ...], [name: "Movie", value: ...]

Post a Comment for "How Can I Access The Properties Of My Json Object Using Jquery In This Jsfiddle?"