[[+content_image]]
K
K
kripok952015-12-13 04:20:53
JavaScript
kripok95, 2015-12-13 04:20:53

Why does it output [[object Object]?

$.getJSON( "http://2hd.com.ua/api/v1/orders/1", function( data ) {
        var items = [];
        $.each( data, function( key, val ) {
            items.push( "<li id='" + key + "'>" + val + "</li>" );
        });

        $( "<ul/>", {
            "class": "my-new-list",
            html: items.join( "" )
        }).appendTo( "body" );
    });

Achieved the output, but displays [object Object], please help, what's the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question