title: Get attributes of model in backbone.js
body: <p>I have this model</p>
  
  <pre><code>var Item = Backbone.Model.extend({
     url: 'http://localhost/InterprisePOS/Product/loaditembycategory/Event Materials'
  });
  
  var onSuccess = function(){ alert("success"); };
  </code></pre>
  
  <p>And a collection</p>
  
  <pre><code>var Items = Backbone.Collection.extend({
      model: Item
  });
  </code></pre>
  
  <p>And the rest of my code is here:</p>
  
  <pre><code>var item = new Item();
  var items = new Items();
  item.fetch({ success: onSuccess });
  alert(items.get("ItemCode"));
  </code></pre>
  
  <p>What I want is to simply get the attributes of the model. Now I have this on firebug. Also when I run it on the browser I get the alert <strong>success</strong> and the next alert is <strong>undefined</strong>.
  <img src="https://i.stack.imgur.com/AJjle.jpg" alt="enter image description here"></p>
  
  <p>This is the output:</p>
  
  <pre><code>{"ErrorMessage":null,"Items":[{"ErrorMessage":null,"CategoryCode":"Event Materials","ClassCode":null,"Components":null,"GroupCode":null,"ImageURL":null,"ItemCode":"ITEM-123","ItemDescription":"Old World Lamppost\u000d\u000a\u000d\u000a","ItemName":"GET123","ItemType":null,"KitItem":null,"Matrix":null,"Prefix":null,"RetailPrice":107.990000,"SalesTaxCode":null,"UPCCode":null,"UnitMeasureCode":"EACH","UnitsInStock":0,"Value":null,"WholesalePrice":95.000000}]}
  </code></pre>
  
  <h1>NOTE</h1>
  
  <p>That is just one of the items it returns. I just posted on item so that it won't be that long.</p>