Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 19th, 2012  |  syntax: JavaScript  |  size: 0.66 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (function (pdp, $) {
  2.  
  3.         var m = pdp.models;
  4.    
  5.     m.Details = Backbone.Model.extend({
  6.         "urlRoot": "/data/pdp-details.json",
  7.         "initialize": function() {
  8.                 this.fetch({
  9.                     "error": function(model, response) {
  10.                         console.log('Details:initialize:FETCH ERROR:model: '+JSON.stringify(model.toJSON()));
  11.                         console.log('Details:initialize:FETCH ERROR:response: '+JSON.stringify(response));
  12.                     }
  13.                 });
  14.             }
  15.     });
  16.  
  17. }(window.app.pdp, jQuery));
  18.  
  19. .
  20. .
  21. .
  22. console.log(JSON.stringify(new pdp.models.Details().toJSON()));
  23.  
  24. prints '{}'