基本例子

sync() 方法读取并获取模型数据

     Backbone.sync = function(method, model) {
        document.write("The state of the model is:");
        document.write("<br>");

        //The 'method' specifies state of the model
        document.write(method + ": " + JSON.stringify(model));
     };

     //'myval' is a collection instance and contains the values which are to be fetched in the collection
     var myval = new Backbone.Collection({
        site:"mrfarhad.ir",
        title:"Farhad Mehryari Official Website"
     });

     //The myval.fetch() method displays the model's state by delegating to sync() method
     myval.fetch();

此代码将输出:

The state of the model is:
read: [{"site":"mrfarhad.ir","title":"Farhad Mehryari Official Website"}]