Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 1st, 2011  |  syntax: HTML  |  size: 1.06 KB  |  views: 151  |  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. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
  5.     <title>test</title>
  6.     <script type="text/javascript" src="js/lib/jquery-ui-1.8.12.custom/js/jquery-1.5.1.min.js"></script>
  7.     <script type="text/javascript" src="js/lib/Underscore.js 1.1.4/underscore-min.js"></script>
  8.     <script type="text/javascript" src="js/lib/Backbone.js 0.3.3/backbone.js"></script>
  9.     <script type="text/javascript" src="js/lib/json2.js"></script>
  10.     <script type="text/javascript">
  11.                 (function() {
  12.                    window.school = Backbone.Model.extend({});
  13.                 }).call(this);
  14.                
  15.                 (function() {
  16.                   window.schools = Backbone.Collection.extend({
  17.                     url: '/schools',
  18.                     model: window.school
  19.                   });
  20.                 }).call(this);
  21.                
  22.                 var f = new window.school({name: "temp"});
  23.                
  24.                 console.log("f", f);
  25.                 // displays: f, inherits.child
  26.                 console.log("f.id", f.id);
  27.                 // displays: f.id undefined
  28.                 f.save();
  29.                 // displays: Uncaught Error: A 'url' property or function must be specified
  30.         </script>
  31. </head>
  32. <body
  33. </body>
  34. </html>