Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Backbone Model Most Simple

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Simple Backbone.js</title>
 </head>
<body> 
 
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js" type="text/javascript"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"></script>
 
  <script type="text/javascript">
    'use strict';
    var Song = Backbone.Model.extend({
initialize: function(){
console.log("You created a new song, yeah.");
}
});

var song = new Song();

  </script>
  
</body>
</html>

/*will simply display the console.log message*/
 
PREVIOUS NEXT
Tagged: #Backbone #Model #Most #Simple
ADD COMMENT
Topic
Name
6+1 =