Error: Get JSON Data from Web API Using Jquery
        Posted  
        
            by 
                Kenneth
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Kenneth
        
        
        
        Published on 2013-11-09T21:49:33Z
        Indexed on 
            2013/11/09
            21:53 UTC
        
        
        Read the original article
        Hit count: 258
        
jQuery
|asp.net-web-api
I'm really new at this. And I'm really stuck. I have the jquery code, it will load data from Web API, but it does not display on my page.
$.getJSON("/api/Order", function(data) {
            if (data != null) {
                var str = '';
                $.each(data, function (item) {
                    str = '<li>' + item.ItemName + '</li>';
                });
                $("#contents").append(str);
            }
        });
Can anyone explain what is going on? Thanks.
© Stack Overflow or respective owner