SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
Why Javascript Doesn’t Suck
or javascript outside the DOM
..sometimes it can suck

• Cross Browser DOM incompatibilities (and surprisingly its not all IE’s fault)


• Ugly looking code (compared to some other languages *cough* ruby *cough*)


• Poorly written code


• Global Namespace


• Lives inside the browser (it doesn’t have to)
but..

• Most widely used functional programming language ever (eat your heart out
  LISP)


• lambda’s FTW


• Objects!!! (and JSON)


• Metaprogramming goodness (think ruby)


• Duck typed


• Light and easy (pretty much the opposite of Java)
you too can make it suck less

                                                      Module Pattern
var Positioning = function(){
    //private members
    var _x = 0;
    var _y = 0;

    return {
        //priviledged functions, have access to private members/functions
        setPosition: function(x,y){
            _x = x;
            _y = y;
        },
        getPosition: function(){
             return new Array(_x, _y);
        }

    }
}();

Positioning.setPosition(50, 100);
Positioning.getPosition(); // [50, 100]
metaprogramming
var barCamp = {
                                                           “send”
   sayHello: function(){
       alert quot;Helloquot;;
   }

}
barCamp.sayHello // alerted quot;Helloquot;
barCamp['sayHello'] // alerted quot;Helloquot;
barCamp.hasOwnProperty('sayHello') // true
//define_method in 3 lines of code
Function.prototype.define_method = function(name, func){
   this.prototype[name] = func;
   return this;
}

Positioning.define_method('deletePositions', function(){...})
prototype this

                                        prototype inheritance
function Bar(){
    this.member = initializer;
    return this;
}
Bar.prototype.sayHello = function(){ alert quot;Hello I am Barquot;; }
var barObject = new Bar();
barObject.prototype == Bar.prototype
barObject.constructor == Bar()
barObject.sayHello() // alerts quot;Hello I am Barquot;
function Foo(){
    this.member = initializer;
    return this;
}
Foo.prototype = new Bar();
Foo.prototype.sayHello = function(){ alert quot;Hello I am Fooquot;; }
var fooObject = new Foo();
fooObject.sayHello() //alerts quot;Hello I am Fooquot;
no more new

function object(parentObject){
    //create a dummy constructor function for our new object
    function F(){};
    // the dummy function's prototype member is now the parentObject
    F.prototype = parentObject;
    // return an object with the dummy function's prototype member
    return new F();
}

var bar = {
   sayHello: function(){...}
};

var foo = object(bar);
foo.sayHello() // alerts “Hello I am Bar”
hold your arguments to later please

Bar.prototype.setFavoriteDrinks = function(person) {
    var drinks = Array.prototype.slice.apply(arguments, [1]);
    alert(person + quot;'s favorite drinks are: quot; + drinks.join(', '));
}
var barCamp = new Bar()
// hint ill accept any of these as a thank you later tonight
barCamp.setFavoriteDrinks(quot;the dudequot;, quot;White Russionquot;, quot;Red Bull and Vodkaquot;,
quot;Irish Car Bombquot;, quot;Guinessquot;);
//alert quot;the dude's favorite drinks are White Russion, Red Bull and Vodka, Irish
Car Bomb, Guinessquot;
bye bye browser
//model

                                                     TrimPath junction
Contact = function() {}
with (modelFor('Contact')) {
     validatesPresenceOf('first_name');
     validatesPresenceOf('last_name');
}
//controller
ContactController = function() {}
scaffold(ContactController, 'Contact');
//view
<h1>Contacts</h1>

 <%= linkToLocal('Create A New Contact', 'contact', 'newInstance') %>

 <ul>
   <% for (var i = 0; i < contacts.length; i++) { %>
      <li><%= linkToLocal(contacts[i].last_name + ', ' + contacts[i].first_name,
          'contact', 'show', contacts[i].id) %></li>
   <% } %>
 </ul>
thanks to...

         Doug Crockford Advanced Javascript 1 + 2:
    http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027823
   http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027832


 Dustin Diaz Javascript site: www.dustindiaz.com
         Douglas Crockford quot;Javascript - The Goodquot;
                    http://video.yahoo.com/video/play?vid=630959


   http://yuiblog.com/blog/2007/06/12/module-pattern/
and of course




      http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanagan/dp/1565923928
Eric Allam - last100meters.com

payperpost.com

Contenu connexe

Tendances

Javascript & Ajax Basics
Javascript & Ajax BasicsJavascript & Ajax Basics
Javascript & Ajax Basics
Richard Paul
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
julien pauli
 

Tendances (20)

Web 4 | Core JavaScript
Web 4 | Core JavaScriptWeb 4 | Core JavaScript
Web 4 | Core JavaScript
 
Composition in JavaScript
Composition in JavaScriptComposition in JavaScript
Composition in JavaScript
 
Php string function
Php string function Php string function
Php string function
 
De 0 a 100 con Bash Shell Scripting y AWK
De 0 a 100 con Bash Shell Scripting y AWKDe 0 a 100 con Bash Shell Scripting y AWK
De 0 a 100 con Bash Shell Scripting y AWK
 
Learning Perl 6
Learning Perl 6 Learning Perl 6
Learning Perl 6
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
 
Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0
 
Javascript & Ajax Basics
Javascript & Ajax BasicsJavascript & Ajax Basics
Javascript & Ajax Basics
 
Methods of debugging - Atomate.net
Methods of debugging - Atomate.netMethods of debugging - Atomate.net
Methods of debugging - Atomate.net
 
The promise of asynchronous PHP
The promise of asynchronous PHPThe promise of asynchronous PHP
The promise of asynchronous PHP
 
Javascript
JavascriptJavascript
Javascript
 
Angular 2.0 Views
Angular 2.0 ViewsAngular 2.0 Views
Angular 2.0 Views
 
Functional Programming in PHP
Functional Programming in PHPFunctional Programming in PHP
Functional Programming in PHP
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 
Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Xmpp prebind
Xmpp prebindXmpp prebind
Xmpp prebind
 
Data Types In PHP
Data Types In PHPData Types In PHP
Data Types In PHP
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...
 

En vedette (20)

Participación Ciudadana
Participación CiudadanaParticipación Ciudadana
Participación Ciudadana
 
Lenon
LenonLenon
Lenon
 
Galicia
GaliciaGalicia
Galicia
 
Presentación
PresentaciónPresentación
Presentación
 
Día del estudiante
Día del estudianteDía del estudiante
Día del estudiante
 
Sistema nervioso central
Sistema nervioso centralSistema nervioso central
Sistema nervioso central
 
Essentials Trailer
Essentials  TrailerEssentials  Trailer
Essentials Trailer
 
Julian Beever Desenhosnacal
Julian Beever DesenhosnacalJulian Beever Desenhosnacal
Julian Beever Desenhosnacal
 
Sahara
SaharaSahara
Sahara
 
Apresentaçao Sistemas Tutoriais
Apresentaçao Sistemas TutoriaisApresentaçao Sistemas Tutoriais
Apresentaçao Sistemas Tutoriais
 
Presentation1
Presentation1Presentation1
Presentation1
 
Tour de fotográfico por España
Tour de fotográfico por EspañaTour de fotográfico por España
Tour de fotográfico por España
 
O Eterno Ideal De Beleza
O Eterno Ideal De BelezaO Eterno Ideal De Beleza
O Eterno Ideal De Beleza
 
Prez Fst
Prez FstPrez Fst
Prez Fst
 
Monday Notes #5 9 23 07
Monday Notes #5 9 23 07Monday Notes #5 9 23 07
Monday Notes #5 9 23 07
 
Social Changes Power Point To Upload
Social Changes  Power  Point To UploadSocial Changes  Power  Point To Upload
Social Changes Power Point To Upload
 
18 Sept Hogar De Cristo
18 Sept Hogar De Cristo18 Sept Hogar De Cristo
18 Sept Hogar De Cristo
 
Washington High School Presentation
Washington High School PresentationWashington High School Presentation
Washington High School Presentation
 
Manual Mensis
Manual MensisManual Mensis
Manual Mensis
 
Ghirada Bar Camp Mvno.It Alessandro Morelli Andrey Golub
Ghirada Bar Camp   Mvno.It   Alessandro Morelli   Andrey GolubGhirada Bar Camp   Mvno.It   Alessandro Morelli   Andrey Golub
Ghirada Bar Camp Mvno.It Alessandro Morelli Andrey Golub
 

Similaire à Orlando BarCamp Why Javascript Doesn't Suck

The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
rajivmordani
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest Updates
Iftekhar Eather
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
Dmitry Soshnikov
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
wpnepal
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
Luke Summerfield
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
Stoyan Stefanov
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
Seri Moth
 

Similaire à Orlando BarCamp Why Javascript Doesn't Suck (20)

The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest Updates
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
 
Java script for web developer
Java script for web developerJava script for web developer
Java script for web developer
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
Intro to jquery
Intro to jqueryIntro to jquery
Intro to jquery
 
PHP pod mikroskopom
PHP pod mikroskopomPHP pod mikroskopom
PHP pod mikroskopom
 
Javascript quiz. Questions to ask when recruiting developers.
Javascript quiz. Questions to ask when recruiting developers.Javascript quiz. Questions to ask when recruiting developers.
Javascript quiz. Questions to ask when recruiting developers.
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
 

Dernier

Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
Nauman Safdar
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pillsMifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Abortion pills in Kuwait Cytotec pills in Kuwait
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 

Dernier (20)

Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
Rice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna ExportsRice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna Exports
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
TVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdf
TVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdfTVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdf
TVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdf
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdf
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
New 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck TemplateNew 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck Template
 
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pillsMifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
BeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfBeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdf
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 

Orlando BarCamp Why Javascript Doesn't Suck

  • 1. Why Javascript Doesn’t Suck or javascript outside the DOM
  • 2. ..sometimes it can suck • Cross Browser DOM incompatibilities (and surprisingly its not all IE’s fault) • Ugly looking code (compared to some other languages *cough* ruby *cough*) • Poorly written code • Global Namespace • Lives inside the browser (it doesn’t have to)
  • 3. but.. • Most widely used functional programming language ever (eat your heart out LISP) • lambda’s FTW • Objects!!! (and JSON) • Metaprogramming goodness (think ruby) • Duck typed • Light and easy (pretty much the opposite of Java)
  • 4. you too can make it suck less Module Pattern var Positioning = function(){ //private members var _x = 0; var _y = 0; return { //priviledged functions, have access to private members/functions setPosition: function(x,y){ _x = x; _y = y; }, getPosition: function(){ return new Array(_x, _y); } } }(); Positioning.setPosition(50, 100); Positioning.getPosition(); // [50, 100]
  • 5. metaprogramming var barCamp = { “send” sayHello: function(){ alert quot;Helloquot;; } } barCamp.sayHello // alerted quot;Helloquot; barCamp['sayHello'] // alerted quot;Helloquot; barCamp.hasOwnProperty('sayHello') // true //define_method in 3 lines of code Function.prototype.define_method = function(name, func){ this.prototype[name] = func; return this; } Positioning.define_method('deletePositions', function(){...})
  • 6. prototype this prototype inheritance function Bar(){ this.member = initializer; return this; } Bar.prototype.sayHello = function(){ alert quot;Hello I am Barquot;; } var barObject = new Bar(); barObject.prototype == Bar.prototype barObject.constructor == Bar() barObject.sayHello() // alerts quot;Hello I am Barquot; function Foo(){ this.member = initializer; return this; } Foo.prototype = new Bar(); Foo.prototype.sayHello = function(){ alert quot;Hello I am Fooquot;; } var fooObject = new Foo(); fooObject.sayHello() //alerts quot;Hello I am Fooquot;
  • 7. no more new function object(parentObject){ //create a dummy constructor function for our new object function F(){}; // the dummy function's prototype member is now the parentObject F.prototype = parentObject; // return an object with the dummy function's prototype member return new F(); } var bar = { sayHello: function(){...} }; var foo = object(bar); foo.sayHello() // alerts “Hello I am Bar”
  • 8. hold your arguments to later please Bar.prototype.setFavoriteDrinks = function(person) { var drinks = Array.prototype.slice.apply(arguments, [1]); alert(person + quot;'s favorite drinks are: quot; + drinks.join(', ')); } var barCamp = new Bar() // hint ill accept any of these as a thank you later tonight barCamp.setFavoriteDrinks(quot;the dudequot;, quot;White Russionquot;, quot;Red Bull and Vodkaquot;, quot;Irish Car Bombquot;, quot;Guinessquot;); //alert quot;the dude's favorite drinks are White Russion, Red Bull and Vodka, Irish Car Bomb, Guinessquot;
  • 9. bye bye browser //model TrimPath junction Contact = function() {} with (modelFor('Contact')) { validatesPresenceOf('first_name'); validatesPresenceOf('last_name'); } //controller ContactController = function() {} scaffold(ContactController, 'Contact'); //view <h1>Contacts</h1> <%= linkToLocal('Create A New Contact', 'contact', 'newInstance') %> <ul> <% for (var i = 0; i < contacts.length; i++) { %> <li><%= linkToLocal(contacts[i].last_name + ', ' + contacts[i].first_name, 'contact', 'show', contacts[i].id) %></li> <% } %> </ul>
  • 10. thanks to... Doug Crockford Advanced Javascript 1 + 2: http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027823 http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027832 Dustin Diaz Javascript site: www.dustindiaz.com Douglas Crockford quot;Javascript - The Goodquot; http://video.yahoo.com/video/play?vid=630959 http://yuiblog.com/blog/2007/06/12/module-pattern/
  • 11. and of course http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanagan/dp/1565923928
  • 12. Eric Allam - last100meters.com payperpost.com