title: Jquery Ajax method working with multiple json object but not with single json object
body: <p>when I am sending json object array my jquery ajax method is able to parse content and show data in listview of jquery , but when I have only one single object my same jquery ajax method is not able to parse data.</p>
  
  <p>here my json object array:</p>
  
  <pre><code>{"menuService":[{"idmenu":"0","itemCatagory":"Main Course","itemDescription":"Food from UP","itemImagePath":"http://localhost:8080/fotservice/ItemImage?id=Steam Rice","itemName":"Steam Rice","rate":"100.5","subItemName":"Half Plate Steam Rice","subItemNameRate":"100.5"},{"idmenu":"5","itemCatagory":"Main Course","itemDescription":"tasty lunch","itemImagePath":"http://localhost:8080/fotservice/ItemImage?id=Lunch Combo(raita,rice,dal,salad)","itemName":"Lunch Combo(raita,rice,dal,salad)","rate":"123.0","subItemName":"lunch(dal,rice)","subItemNameRate":"100.5"}]}
  </code></pre>
  
  <p>here is my single json object:</p>
  
  <pre><code>{"menuService":{"idmenu":"2","itemCatagory":"xyz","itemDescription":"fghjkl;","itemImagePath":"http://localhost:8080/fotservice/ItemImage?id=Dal makhni","itemName":"Dal makhni","rate":"121.5","subItemName":"Half plate Dal makhni","subItemNameRate":"121.56"}}
  </code></pre>
  
  <p>and here is my jquery ajax method:</p>
  
  <pre><code>$.ajax({
      url: "http://localhost:8080/fotservice/rest/menu/"+cat+"/items",  
      type: 'GET',
      dataType: 'json',
      contentType: "application/json; charset=utf-8",
      success: function( response ) {
          var markup = "";
          $.each(response.menuService, function(index, result) { 
              var $template = $('&lt;div&gt;&lt;li&gt; &lt;a data-transition="slide" href="desc.html?cat='+result.itemName+'" rel="external" &gt; &lt;img class="profile"&gt; &lt;p class="from"&gt; &lt;/p&gt;&lt;p class="tweet"&gt; &lt;/p&gt;&lt;/li&gt;&lt;/a&gt;&lt;/div&gt;');
              $template.find(".profile").attr("src", result.itemImagePath);
              $template.find(".from").append(result.itemDescription);
  
              markup += $template.html();
          });
          $( "#tweet-list" ).append(markup).listview( "refresh", true ); // The true parameter indicates we want to refresh the entire list, not just the list items. 
  
      },
      timeout: 6000,  // Timeout after 6 seconds
      error: function(jqXHR, textStatus, errorThrown) {
          console.log("Error, textStatus: " + textStatus + " errorThrown: "+ errorThrown);
  
          $.mobile.hidePageLoadingMsg();
  
          //show error message
          $( "&lt;div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'&gt;&lt;h1&gt;"+ $.mobile.pageLoadErrorMessage +"&lt;/h1&gt;&lt;/div&gt;" )
              .css({ "display": "block", "opacity": 0.96, "top": 100 })
              .appendTo( $.mobile.pageContainer )
              .delay( 800 )
              .fadeOut( 1000, function() {
                  $( this ).remove();
              });
      }
  });
  </code></pre>
  
  <p>I tried jquery getjson method but that is also shoing the same behavior. </p>