document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  var book = Backbone.Model.extend({
  2.     defaults : {                  //--- model default values
  3.      "title" : " JavaScript- The Good Parts",
  4.      "author" : "Douglas Crockford"
  5.     },
  6.     url : \'http://myApp.lk/book\'  //--- to sync data with server(CURD)
  7. });
  8.  
  9. var shell = Backbone.View.extend({
  10.     el : $(\'#myDiv\'), //-- මෙම view එකට අදාල DOM කොටස
  11.     model : book,     //-- or collection : names (List එකක් නම්)
  12.     render :function(){    // DOM වෙනස් කරන function එක
  13.         this.$el.html(this.model.get(\'name\'));
  14.     },
  15.     setPages : function(){
  16.         this.$el.append(this.model.get(\'pages\'));
  17.     }
  18. });
');