Backbone.JS Fetch()

The Backbone.JS Fetch() collection method extracts the data from the model in a collection.

Syntax:

Collection.Fetch ( options )   

Parameters: options: This parameter is used to specify the “SUCCESS” or “ERROR” callbacks.

Example:



  
Example  
  
  
  
  
  
  
  
  

Output:

Fetched data: read: [{"id":100,"name":"Happy"}]

Explanation: In the above example, the Fetch() method retrieves the data of the collection instance ‘values’.

Please follow and like us:
Content Protection by DMCA.com