SlideShare a Scribd company logo
for




 Lukas Renggli
ESUG 2009, Brest
‣ John Resig, jquery.com
‣ Lightweight, fast and concise
   - Document traversing
   - Event Handling
   - AJAX Interaction
   - Animating
‣ High-level, themeable widgets on top of
  JQuery.

  - Draggable               - Datepicker
  - Droppable               - Dialog
  - Sortable                - Progressbar
  - Selectable              - Slider
  - Resizable               - Tabs
  - Accordion
T1ooousands
 of Plugins
For   Experts
Forget about
$(document).ready(...)
Don’t care about
    “unobtrusive”
For   Experts
Say it in
Smalltalk
Feature
Complete
Up-to-date
only
     5 slides
                s l ide   5
       only             s

   Everything
you need to know
Query + Action
OM
   nd D s
Fi
 e le m e nt


      Query + Action
OM
   nd D s
Fi
 e le m e nt


      Query + Action
                  Pe r fo r m
                 a n a ct i o
                              n
Create a Query
html jQuery: ‘.special’
Create a Query
html jQuery: ‘.special’


                  Q uer y La ng uage
                        is C S S
Create a Query
          html jQuery: ‘.special’


S m a l lt a k p ro                Q uer y La ng uage
                    x y o bje ct
   JQ u e r yI n st a                    is C S S
                       nce
Perform an Action
(html jQuery: ‘div.special’) remove
Perform an Action
(html jQuery: ‘div.special’) remove

           . . . a nd 1 80 ot h e r
          (we l l do   c u m e nte d)
                    a ctio n s
Attaching to Element
	   html anchor

   
 onClick: (html jQuery: ‘div’)

   
 
 remove;

   
 with: ‘Remove’
Attaching to Element
	   html anchor

   
 onClick: (html jQuery:this)
                     jQuery ‘div’)

   
 
 remove;

   
 with: ‘Remove’
                       Sh o r tc u t, se e
                        JQuer   yC l a s s
At Load-Time
html document addLoadScript:

 (html jQuery: ‘div’) remove
Query Examples
$(“div.hint”)


html jQuery expression: ‘div.hint’

     html jQuery: ‘div.hint’
$(“#foo”)


html jQuery id: ‘foo’

 html jQuery: #foo
$(“*”)


html jQuery expression: ‘*’

      html jQuery all
$(this)


html jQuery this

html jQuery new
Refine Queries
Siblings
  aQuery siblings
aQuery siblings: ‘div’
Next Siblings
    aQuery next
  aQuery next: ‘div’
   aQuery nextAll
 aQuery nextAll: ‘div’
Previous Siblings
     aQuery previous
  aQuery previous: ‘div’
      aQuery prevAll
   aQuery prevAll: ‘div’
Children
  aQuery children
aQuery children: ‘div’

  aQuery contents
  aQuery find: ‘div’
Parent
  aQuery parent
aQuery parent: ‘div’

  aQuery parents
aQuery parents: ‘div’

  aQuery closest
aQuery closest: ‘div’
Perform Actions
Classes
  aQuery addClass: ‘foo’
aQuery removeClass: ‘foo’
 aQuery toggleClass: ‘foo’
  aQuery hasClass: ‘foo’
Attributes
 aQuery attributes: aDictionary
   aQuery attributeAt: ‘href’
aQuery attributeAt: ‘href’ put: ‘#’
 aQuery removeAttribute: ‘href’
Styles
   aQuery css: aDictionary
    aQuery cssAt: ‘color’
aQuery cssAt: ‘color’ put: ‘#ff0’
Contents
 aQuery html: [ :r | r div ]
aQuery value: ‘some value’
 aQuery text: ‘some text’
Insert Contents
 aQuery before: [ :r | r div ]
aQuery prepend: [ :r | r div ]
aQuery append: [ :r | r div ]
  aQuery after: [ :r | r div ]
Replace Contents
aQuery replaceWith: [ :r | r div ]
   aQuery wrap: [ :r | r div ]
  aQuery wrapAll: [ :r | r div ]
 aQuery wrapInner: [ :r | r div ]
Animations
    aQuery show
aQuery show: 1 second

    aQuery hide
aQuery hide: 1 second
Events
   aQuery onClick: ‘alert(“Hello”)’
 aQuery on: ‘click’ do: ‘alert(“Hello”)’
aQuery on: ‘click’ once: ‘alert(“Hello”)’

        aQuery trigger: ‘click’
AJAX
AJAX
aQuery load html: [ :r | r div: Time now ]
No Query
html jQuery ajax
Generators
    anAjax html: [ :r | r div ]
anAjax script: [ :s | s alert: ‘Hello’ ]
Triggering Callbacks
         anAjax serialize: aQuery
anAjax trigger: [ :p | ... ] passengers: aQuery
 anAjax callback: [ :v | ... ] value: anObject
More Information
JQuery Docs
 docs.jquery.com
Functional Tests
 /seaside/tests/jquery
/seaside/tests/jquery-ui
File Libraries


JQDevelopmentLibrary     JQuery – Full

JQDeploymentLibrary      JQuery – Compressed

JQGoogleLibrary          JQuery – Google

JQUiDevelopmentLibrary   JQuery UI – Full

JQUiDeploymentLibrary    JQuery UI – Compressed

JQUiGoogleLibrary        JQuery UI – Google
How To
Click and Show


html anchor
	 onClick: (html jQuery: 'div.help') toggle;
	 with: 'About jQuery'.

html div
	 class: 'help';
	 style: 'display: none';
	 with: 'jQuery is a fast and ...'
Replace a Component


html div
	 id: (id := html nextId);
	 with: child.

html anchor
	 onClick: ((html jQuery id: id) load
	 	 html: [ :r |
	 	 	 child := OtherComponent new;
	 	 	 r render: child ]);

 with: ‘Change Component’
Update Multiple Elements


html div id: #date.
html div id: #time.

html anchor
	 onClick: (html jQuery ajax script: [ :s |
	 	 s << (s jQuery: #date)
	 	 	 html: [ :r | r render: Date today ].
	 	 s << (s jQuery: #time)
	 	 	 html: [ :r | r render: Time now ] ]);
  with: ‘Update’
Display a Lightbox

| id |
html div
	 id: (id := html nextId);
	 script: (html jQuery new dialog
	 	 title: 'Lightbox Dialog';
	 	 overlay: (Dictionary new
	 	 	 at: 'background-color' put: '#000';
	 	 	 at: 'opacity' put: 0.75;
	 	 	 yourself);
	 	 modal: true);
	 with: [ self renderDialogOn: html ]
html anchor
	 onClick: (html jQuery id: id) dialog open;
	 with: 'Open Lightbox'

More Related Content

PDF
jQuery (MeshU)
PDF
jQuery (BostonPHP)
PDF
Processing and Processing.js
PDF
JavaScript Libraries (Kings of Code)
PDF
JavaScript Libraries (@Media)
PDF
jQuery Loves Developers - Oredev 2009
PDF
JavaScript 1.5 to 2.0 (TomTom)
PDF
Write Less Do More
jQuery (MeshU)
jQuery (BostonPHP)
Processing and Processing.js
JavaScript Libraries (Kings of Code)
JavaScript Libraries (@Media)
jQuery Loves Developers - Oredev 2009
JavaScript 1.5 to 2.0 (TomTom)
Write Less Do More

What's hot (19)

PDF
jQuery (DrupalCamp Toronto)
PDF
jQuery Presentation to Rails Developers
PDF
Merb jQuery
PDF
Prototype & jQuery
PDF
jQuery Essentials
PDF
The Dom Scripting Toolkit J Query
KEY
The jQuery Library
PPTX
Getting the Most Out of jQuery Widgets
PDF
jQuery in the [Aol.] Enterprise
PPTX
Intro to jQuery
PDF
Reactive Type-safe WebComponents
PDF
DOM Scripting Toolkit - jQuery
PDF
Shibuya.js Lightning Talks
PPTX
jQuery PPT
DOCX
Java script slideshow by karan chanana
PDF
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
PPSX
JQuery Comprehensive Overview
PPTX
FuncUnit
PPTX
jQuery Has Coding Standards
jQuery (DrupalCamp Toronto)
jQuery Presentation to Rails Developers
Merb jQuery
Prototype & jQuery
jQuery Essentials
The Dom Scripting Toolkit J Query
The jQuery Library
Getting the Most Out of jQuery Widgets
jQuery in the [Aol.] Enterprise
Intro to jQuery
Reactive Type-safe WebComponents
DOM Scripting Toolkit - jQuery
Shibuya.js Lightning Talks
jQuery PPT
Java script slideshow by karan chanana
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
JQuery Comprehensive Overview
FuncUnit
jQuery Has Coding Standards
Ad

Similar to jQuery for Seaside (20)

PDF
JQuery in Seaside
PPT
J query introduction
PDF
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
ODP
Jquery- One slide completing all JQuery
PPTX
Web Development Introduction to jQuery
PDF
Learning jQuery made exciting in an interactive session by one of our team me...
PPTX
Getting Started with jQuery
PDF
Short intro to JQuery and Modernizr
PPT
JQuery introduction
PPTX
Upstate CSCI 450 jQuery
PPTX
JQuery
PDF
Remy Sharp The DOM scripting toolkit jQuery
PDF
An Introduction to Jquery
PPTX
Jquery Complete Presentation along with Javascript Basics
PPT
Jquery presentation
PDF
Introduzione JQuery
PDF
Yearning jQuery
PDF
Jquery tutorial-beginners
PDF
Introduction to jQuery (Ajax Exp 2007)
PPTX
JQuery in Seaside
J query introduction
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Jquery- One slide completing all JQuery
Web Development Introduction to jQuery
Learning jQuery made exciting in an interactive session by one of our team me...
Getting Started with jQuery
Short intro to JQuery and Modernizr
JQuery introduction
Upstate CSCI 450 jQuery
JQuery
Remy Sharp The DOM scripting toolkit jQuery
An Introduction to Jquery
Jquery Complete Presentation along with Javascript Basics
Jquery presentation
Introduzione JQuery
Yearning jQuery
Jquery tutorial-beginners
Introduction to jQuery (Ajax Exp 2007)
Ad

More from Lukas Renggli (19)

PDF
Mastering Grammars with PetitParser
PDF
Natural Language Checking with Program Checking Tools
PDF
The Dynamic Language is not Enough
PDF
Dynamic Language Embedding With Homogeneous Tool Support
PDF
Seaside — Agile Software Development
PDF
Dynamic grammars
PDF
Domain-Specific Program Checking
PDF
Embedding Languages Without Breaking Tools
PDF
Language Boxes — Bending the Host Language with Modular Language Changes
PDF
Seaside Status Message
PDF
Seaside - The Revenge of Smalltalk
PDF
Magritte Blitz
PDF
Seaside - On not getting bogged down
PDF
Magritte
PDF
Seaside - Past, Present and Future
PDF
Magritte - A Meta-Driven Approach to Empower Developers and End Users
PDF
Transactional Memory for Smalltalk
PDF
Seaside - Web Development As You Like It
PDF
5 Steps to Mastering the Art of Seaside
Mastering Grammars with PetitParser
Natural Language Checking with Program Checking Tools
The Dynamic Language is not Enough
Dynamic Language Embedding With Homogeneous Tool Support
Seaside — Agile Software Development
Dynamic grammars
Domain-Specific Program Checking
Embedding Languages Without Breaking Tools
Language Boxes — Bending the Host Language with Modular Language Changes
Seaside Status Message
Seaside - The Revenge of Smalltalk
Magritte Blitz
Seaside - On not getting bogged down
Magritte
Seaside - Past, Present and Future
Magritte - A Meta-Driven Approach to Empower Developers and End Users
Transactional Memory for Smalltalk
Seaside - Web Development As You Like It
5 Steps to Mastering the Art of Seaside

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
sap open course for s4hana steps from ECC to s4
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25 Week I

jQuery for Seaside