SlideShare a Scribd company logo
Javascript applications and the
quest for Sanity
Facts about Javascript

    Javascript was spawned and mutated (not born and nurtured) in the dank halls of
    Netscape tor.
Peace across the land
Modern Javascript is culture
The Good Parts

   Javascript is a flexible, loosley typed language.

   It can be and has been bent in many different ways.
   eg check out http://dailyjs.com/2012/11/26/js101-proto/
The Good Parts

  Javascript gives us ways to expand and manipulate it.

  Eg) Namespaces

  	   Single Global Variables
  	
  	   Object Literals

  	   Nested namespaces
The Good Parts

   eg) Closures

   	   Passing information back and forth

   	   Returning Functions

   	   Reference instead of Create
   	   via http://stackoverflow.com/questions/111102/how-do-javascript-closures-work
The Bad Part

   Gets Messy Quickly

   	Why?
   	
   		 SCOPE and @#%*(@#$* Global Variables


   Not always consistent

   	   eg) Semicolon insertion
The Bad Part

   Really easy to let it get away from you.
Structures and Exploration




                     http://forum.woodenboat.com/showthread.php?112363-
                     Voronoi-Diagrams-in-Nature
You want to make a web app?

   Lets forget about the code for a minute.



   What are you trying to solve?

   Who is going to use your application?

   Where does your tool live?

   How much time do you have to make it?

   What does it actually do?
Sketch and Sketch and Sketch
Formalize your sketching
List out what you need to do
Sketch a bit more
Let’s build something now...?
Model View Controller




   http://www.codinghorror.com/blog/2008/05/understanding-model-view-controller.html
Model View Presenter
Model View ********@
BackboneJS
Intro to Backbone

   What is Backbone?

   	   Backbone is an awesome frameworks for organizing javascript projects.

   	   Set of tools that help you manage complexity.

   	   Set of methods and formalized conventions that are a given in modern Javascript

   	   Powerful way to approach building Single Page Applications
Backbone Building Blocks

   Model

   Collection

   View

   Router
Backbone Model

   Represents your data and what it’s
   supposed to do.

   The idea of the thing, not the thing.

   Holds defaults, holds checking
   functions.
Backbone Collection

   Collections hold groups of model data.

   Says how these models are stored and
   where they go when they die.

   Orders the data and lets you get informa-
   tion about it.
Backbone View

   Views are how the data and differ-
   ent parts of your application are
   represented.

   How do you render out your ToDo,
   or your portfolio piece?

   What are the different parts of
   your app? (This is why we sketch,
   by the way!)
Backbone Router

   Routers help you manage states.

   States are how your application know
   what’s what.

   Our different states:
   Standing
   Sitting
   Lying down
   Sleeping
   Dreaming

   How are those states represented?
And ‘lo, magic.
Framework to form

   Challenge is to translate the framework that Backbone gives us into the final applica-
   tion.

   Lets look at:

   	Data

   	Templates

   	Behaviour
Data and your app

   Most modern applications require a database.

   Localstorage is an HTML5 spec that lets you keep and persist info all within the client
   side, i.e. the browser. But doesn’t let you share across.

   Backbone lets you drop in localstorage first, and worry about the DB later.

   eg) Meaning Clock started off as a localstorage app before I wrote the NodeJS server
   with a MongoDB database.




   This is why we make lists. They will help you decide what is best for you.
Backbone.sync

   Backbone.sync is a method to synchronize your collections and models across
   systems.

   So, how do I make this work with my server and data?

   var methodMap = {
   	 ’create’: ’POST’
   	 , ’update’: ’PUT’
   	 , ’delete’: ’DELETE’
   	 , ’read’: ’GET’
   };


   Comes with a default way to manage data via the CRUD method.
   Great for Node or Ruby on Rails.

   Can be overridden if you want something custom.
Local vs. Remote storage
Templates

           Templates are how you separate HTML from JS.
           Make sense of the different KNOWN (again, sketching) states of your app.


MyApp.js



                                                                Index.jade
Underscore.js

   Framework for dealing with data.

   Powers a lot of the BackboneJS tools, and is hugely worth learning.

   Strong way to work with models and views.
That el thing

    The el element refers to a DOM element in the backbone.view

    Few different ways to deal with it.

    $el is an easy to use jquery object

    this.el is the standard Javascript DOM object.

    I often do

    this.$el.someJqueryFunction().anotherChainedjQueryFunction();

    another option is this

    	$(this.el).html(this.template);

    This reners the template defined in
    	 el: $(‘#inviteToEnter’)
    		 , template: _.template($(“#blankMeaning”).html())
    to #inviteToEnter
Lets Look At Some Code
My Own App, The Meaning Clock   A much better programmed app, todoMVC

           Javascript
Things to remember

   Backbone is a FRAMEWORK, not a solution per se.
   It helps you organize your thinking and avoid getting overwhelmed if you use it right.


   Think and Sketch first, code later.
   It’s hugely valuable to do both, but drawing your app to scale on a piece of paper
   and pretending to interact with it is a hell of a lot more time effective than coding the
   wrong thing eight times.

   Use documentation and resources
   See the github repo for resources,
   http://github.com/readywater/backbonejs_workshop
Andrew Lovett-Barron

@readywater

http://readywater.ca

http://relaystudio.com

http://github.com/readywater

More Related Content

What's hot (19)

The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
Matt Raible
 
Intro to emberjs
Intro to emberjs
Mandy Pao
 
Dependency Management with RequireJS
Dependency Management with RequireJS
Aaronius
 
Rails course day 7
Rails course day 7
Al Sayed Gamal
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & Tricks
Hjörtur Hilmarsson
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
jQuery
jQuery
Ivano Malavolta
 
In-depth changes to Drupal 8 javascript
In-depth changes to Drupal 8 javascript
Théodore Biadala
 
Web&java. jsp
Web&java. jsp
Asya Dudnik
 
Short intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
Jussi Pohjolainen
 
JQuery
JQuery
Jussi Pohjolainen
 
Getting Started with Angular JS
Getting Started with Angular JS
Akshay Mathur
 
Integrating AngularJS with Drupal 7
Integrating AngularJS with Drupal 7
andrewmriley
 
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Krista Thomas
 
Upgrade your javascript to drupal 8
Upgrade your javascript to drupal 8
Théodore Biadala
 
Multi screen HTML5
Multi screen HTML5
Ron Reiter
 
Intro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
Effective cassandra development with achilles
Effective cassandra development with achilles
Duyhai Doan
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
NCCOMMS
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
Matt Raible
 
Intro to emberjs
Intro to emberjs
Mandy Pao
 
Dependency Management with RequireJS
Dependency Management with RequireJS
Aaronius
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & Tricks
Hjörtur Hilmarsson
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
In-depth changes to Drupal 8 javascript
In-depth changes to Drupal 8 javascript
Théodore Biadala
 
Short intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
Jussi Pohjolainen
 
Getting Started with Angular JS
Getting Started with Angular JS
Akshay Mathur
 
Integrating AngularJS with Drupal 7
Integrating AngularJS with Drupal 7
andrewmriley
 
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Phase2 OpenPublish Presentation SF SemWeb Meetup, April 28, 2009
Krista Thomas
 
Upgrade your javascript to drupal 8
Upgrade your javascript to drupal 8
Théodore Biadala
 
Multi screen HTML5
Multi screen HTML5
Ron Reiter
 
Intro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
Effective cassandra development with achilles
Effective cassandra development with achilles
Duyhai Doan
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
NCCOMMS
 

Viewers also liked (6)

Backbonejs Full Stack
Backbonejs Full Stack
Artyom Trityak
 
[XECon2016] A-3 박형식 Frontend stack의 변화 : jQuery, BackboneJS, ReactJS 중심으로
[XECon2016] A-3 박형식 Frontend stack의 변화 : jQuery, BackboneJS, ReactJS 중심으로
XpressEngine
 
Drupal8 + AngularJS
Drupal8 + AngularJS
Daniel Kanchev
 
Top 5 Javascript Frameworks for Web and Mobile App Development
Top 5 Javascript Frameworks for Web and Mobile App Development
Algoworks Inc
 
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
Sumanth Chinthagunta
 
[XECon2016] A-3 박형식 Frontend stack의 변화 : jQuery, BackboneJS, ReactJS 중심으로
[XECon2016] A-3 박형식 Frontend stack의 변화 : jQuery, BackboneJS, ReactJS 중심으로
XpressEngine
 
Top 5 Javascript Frameworks for Web and Mobile App Development
Top 5 Javascript Frameworks for Web and Mobile App Development
Algoworks Inc
 
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
Sumanth Chinthagunta
 
Ad

Similar to Intro to BackboneJS + Intermediate Javascript (20)

Developing Backbonejs Applications Early Release Addy Osmani
Developing Backbonejs Applications Early Release Addy Osmani
littelenkali
 
Developing maintainable Cordova applications
Developing maintainable Cordova applications
Ivano Malavolta
 
Backbone.js slides
Backbone.js slides
Ambert Ho
 
Single Page Applications
Single Page Applications
Massimo Iacolare
 
Developing Backbone js Applications Addy Osmani
Developing Backbone js Applications Addy Osmani
leitaduminy
 
[2015/2016] Backbone JS
[2015/2016] Backbone JS
Ivano Malavolta
 
Backbone JS for mobile apps
Backbone JS for mobile apps
Ivano Malavolta
 
Instant download Developing Backbone js Applications Addy Osmani pdf all chapter
Instant download Developing Backbone js Applications Addy Osmani pdf all chapter
dinetvenitja
 
Backbone.js
Backbone.js
Ivano Malavolta
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JS
Akshay Mathur
 
Backbone.js
Backbone.js
VO Tho
 
Viking academy backbone.js
Viking academy backbone.js
Bert Wijnants
 
Backbone.js
Backbone.js
Ivano Malavolta
 
Backbone.js
Backbone.js
Knoldus Inc.
 
Backbone the Good Parts
Backbone the Good Parts
Renan Carvalho
 
Backbone
Backbone
Sayed Ahmed
 
Intro to-html-backbone
Intro to-html-backbone
zonathen
 
Introduction to Backbone.js
Introduction to Backbone.js
Pragnesh Vaghela
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
Dimitri de Putte
 
Introduction to backbone_js
Introduction to backbone_js
Mohammed Saqib
 
Developing Backbonejs Applications Early Release Addy Osmani
Developing Backbonejs Applications Early Release Addy Osmani
littelenkali
 
Developing maintainable Cordova applications
Developing maintainable Cordova applications
Ivano Malavolta
 
Backbone.js slides
Backbone.js slides
Ambert Ho
 
Developing Backbone js Applications Addy Osmani
Developing Backbone js Applications Addy Osmani
leitaduminy
 
Backbone JS for mobile apps
Backbone JS for mobile apps
Ivano Malavolta
 
Instant download Developing Backbone js Applications Addy Osmani pdf all chapter
Instant download Developing Backbone js Applications Addy Osmani pdf all chapter
dinetvenitja
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JS
Akshay Mathur
 
Backbone.js
Backbone.js
VO Tho
 
Viking academy backbone.js
Viking academy backbone.js
Bert Wijnants
 
Backbone the Good Parts
Backbone the Good Parts
Renan Carvalho
 
Intro to-html-backbone
Intro to-html-backbone
zonathen
 
Introduction to Backbone.js
Introduction to Backbone.js
Pragnesh Vaghela
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
Dimitri de Putte
 
Introduction to backbone_js
Introduction to backbone_js
Mohammed Saqib
 
Ad

More from Andrew Lovett-Barron (6)

SF Critical Design meetup: Designed Futures in a non-linear world
SF Critical Design meetup: Designed Futures in a non-linear world
Andrew Lovett-Barron
 
GAFFTA Talk on Decay of Digital Things
GAFFTA Talk on Decay of Digital Things
Andrew Lovett-Barron
 
Having Conversations through Technology in Public Space
Having Conversations through Technology in Public Space
Andrew Lovett-Barron
 
Seeing Like Software
Seeing Like Software
Andrew Lovett-Barron
 
Prototyping for Communication
Prototyping for Communication
Andrew Lovett-Barron
 
Pechakucha 2012 Ambient Technology
Pechakucha 2012 Ambient Technology
Andrew Lovett-Barron
 
SF Critical Design meetup: Designed Futures in a non-linear world
SF Critical Design meetup: Designed Futures in a non-linear world
Andrew Lovett-Barron
 
GAFFTA Talk on Decay of Digital Things
GAFFTA Talk on Decay of Digital Things
Andrew Lovett-Barron
 
Having Conversations through Technology in Public Space
Having Conversations through Technology in Public Space
Andrew Lovett-Barron
 
Pechakucha 2012 Ambient Technology
Pechakucha 2012 Ambient Technology
Andrew Lovett-Barron
 

Recently uploaded (20)

High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 

Intro to BackboneJS + Intermediate Javascript

  • 1. Javascript applications and the quest for Sanity
  • 2. Facts about Javascript Javascript was spawned and mutated (not born and nurtured) in the dank halls of Netscape tor.
  • 5. The Good Parts Javascript is a flexible, loosley typed language. It can be and has been bent in many different ways. eg check out http://dailyjs.com/2012/11/26/js101-proto/
  • 6. The Good Parts Javascript gives us ways to expand and manipulate it. Eg) Namespaces Single Global Variables Object Literals Nested namespaces
  • 7. The Good Parts eg) Closures Passing information back and forth Returning Functions Reference instead of Create via http://stackoverflow.com/questions/111102/how-do-javascript-closures-work
  • 8. The Bad Part Gets Messy Quickly Why? SCOPE and @#%*(@#$* Global Variables Not always consistent eg) Semicolon insertion
  • 9. The Bad Part Really easy to let it get away from you.
  • 10. Structures and Exploration http://forum.woodenboat.com/showthread.php?112363- Voronoi-Diagrams-in-Nature
  • 11. You want to make a web app? Lets forget about the code for a minute. What are you trying to solve? Who is going to use your application? Where does your tool live? How much time do you have to make it? What does it actually do?
  • 12. Sketch and Sketch and Sketch
  • 14. List out what you need to do
  • 15. Sketch a bit more
  • 17. Model View Controller http://www.codinghorror.com/blog/2008/05/understanding-model-view-controller.html
  • 21. Intro to Backbone What is Backbone? Backbone is an awesome frameworks for organizing javascript projects. Set of tools that help you manage complexity. Set of methods and formalized conventions that are a given in modern Javascript Powerful way to approach building Single Page Applications
  • 22. Backbone Building Blocks Model Collection View Router
  • 23. Backbone Model Represents your data and what it’s supposed to do. The idea of the thing, not the thing. Holds defaults, holds checking functions.
  • 24. Backbone Collection Collections hold groups of model data. Says how these models are stored and where they go when they die. Orders the data and lets you get informa- tion about it.
  • 25. Backbone View Views are how the data and differ- ent parts of your application are represented. How do you render out your ToDo, or your portfolio piece? What are the different parts of your app? (This is why we sketch, by the way!)
  • 26. Backbone Router Routers help you manage states. States are how your application know what’s what. Our different states: Standing Sitting Lying down Sleeping Dreaming How are those states represented?
  • 28. Framework to form Challenge is to translate the framework that Backbone gives us into the final applica- tion. Lets look at: Data Templates Behaviour
  • 29. Data and your app Most modern applications require a database. Localstorage is an HTML5 spec that lets you keep and persist info all within the client side, i.e. the browser. But doesn’t let you share across. Backbone lets you drop in localstorage first, and worry about the DB later. eg) Meaning Clock started off as a localstorage app before I wrote the NodeJS server with a MongoDB database. This is why we make lists. They will help you decide what is best for you.
  • 30. Backbone.sync Backbone.sync is a method to synchronize your collections and models across systems. So, how do I make this work with my server and data? var methodMap = { ’create’: ’POST’ , ’update’: ’PUT’ , ’delete’: ’DELETE’ , ’read’: ’GET’ }; Comes with a default way to manage data via the CRUD method. Great for Node or Ruby on Rails. Can be overridden if you want something custom.
  • 31. Local vs. Remote storage
  • 32. Templates Templates are how you separate HTML from JS. Make sense of the different KNOWN (again, sketching) states of your app. MyApp.js Index.jade
  • 33. Underscore.js Framework for dealing with data. Powers a lot of the BackboneJS tools, and is hugely worth learning. Strong way to work with models and views.
  • 34. That el thing The el element refers to a DOM element in the backbone.view Few different ways to deal with it. $el is an easy to use jquery object this.el is the standard Javascript DOM object. I often do this.$el.someJqueryFunction().anotherChainedjQueryFunction(); another option is this $(this.el).html(this.template); This reners the template defined in el: $(‘#inviteToEnter’) , template: _.template($(“#blankMeaning”).html()) to #inviteToEnter
  • 35. Lets Look At Some Code My Own App, The Meaning Clock A much better programmed app, todoMVC Javascript
  • 36. Things to remember Backbone is a FRAMEWORK, not a solution per se. It helps you organize your thinking and avoid getting overwhelmed if you use it right. Think and Sketch first, code later. It’s hugely valuable to do both, but drawing your app to scale on a piece of paper and pretending to interact with it is a hell of a lot more time effective than coding the wrong thing eight times. Use documentation and resources See the github repo for resources, http://github.com/readywater/backbonejs_workshop