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 i de   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
Sd1sbk seni budayadanketerampilan dyahrucilukman
DOCX
Surat permohonan tambah ptk dapodik
PPTX
Bahan Tayang-Modul Projek(1)(1).pptx
DOC
Kata pengantar
PPTX
Materi Kriteria Ketercapaian Tujuan Pembelajaran KKTP .pptx
PDF
Petunjuk penggunaan e modul
PDF
Keselarasan kurikulum 2013 smk dengan dunia kerja 1
PDF
Rapor MTs kurikulum 2013
Sd1sbk seni budayadanketerampilan dyahrucilukman
Surat permohonan tambah ptk dapodik
Bahan Tayang-Modul Projek(1)(1).pptx
Kata pengantar
Materi Kriteria Ketercapaian Tujuan Pembelajaran KKTP .pptx
Petunjuk penggunaan e modul
Keselarasan kurikulum 2013 smk dengan dunia kerja 1
Rapor MTs kurikulum 2013

Similar to JQuery in Seaside (20)

PDF
jQuery for Seaside
PDF
jQuery (MeshU)
PDF
jQuery (BostonPHP)
PDF
jQuery Presentation to Rails Developers
PDF
jQuery (DrupalCamp Toronto)
PDF
jQuery Loves Developers - Oredev 2009
PDF
Mume JQueryMobile Intro
PDF
Introduction to jQuery
PDF
How to make Ajax Libraries work for you
PDF
Reactive Type safe Webcomponents with skateJS
PDF
State of jQuery and Drupal
KEY
Jarv.us Showcase — SenchaCon 2011
PDF
The Dom Scripting Toolkit J Query
PDF
20111014 mu me_j_querymobile
PDF
Yearning jQuery
PDF
JavaScript the Smart Way - Getting Started with jQuery
PDF
Ditching JQuery
PDF
Write Less Do More
PDF
Web2.0 with jQuery in English
PDF
WCLA12 JavaScript
jQuery for Seaside
jQuery (MeshU)
jQuery (BostonPHP)
jQuery Presentation to Rails Developers
jQuery (DrupalCamp Toronto)
jQuery Loves Developers - Oredev 2009
Mume JQueryMobile Intro
Introduction to jQuery
How to make Ajax Libraries work for you
Reactive Type safe Webcomponents with skateJS
State of jQuery and Drupal
Jarv.us Showcase — SenchaCon 2011
The Dom Scripting Toolkit J Query
20111014 mu me_j_querymobile
Yearning jQuery
JavaScript the Smart Way - Getting Started with jQuery
Ditching JQuery
Write Less Do More
Web2.0 with jQuery in English
WCLA12 JavaScript
Ad

More from ESUG (20)

PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
PDF
Directing Generative AI for Pharo Documentation
PDF
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
PDF
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
PDF
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
PDF
Analysing Python Machine Learning Notebooks with Moose
PDF
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
PDF
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
PDF
Package-Aware Approach for Repository-Level Code Completion in Pharo
PDF
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
PDF
An Analysis of Inline Method Refactoring
PDF
Identification of unnecessary object allocations using static escape analysis
PDF
Control flow-sensitive optimizations In the Druid Meta-Compiler
PDF
Clean Blocks (IWST 2025, Gdansk, Poland)
PDF
Encoding for Objects Matters (IWST 2025)
PDF
Challenges of Transpiling Smalltalk to JavaScript
PDF
Immersive experiences: what Pharo users do!
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
PDF
Cavrois - an Organic Window Management (ESUG 2025)
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
Micromaid: A simple Mermaid-like chart generator for Pharo
Directing Generative AI for Pharo Documentation
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
Analysing Python Machine Learning Notebooks with Moose
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
Package-Aware Approach for Repository-Level Code Completion in Pharo
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
An Analysis of Inline Method Refactoring
Identification of unnecessary object allocations using static escape analysis
Control flow-sensitive optimizations In the Druid Meta-Compiler
Clean Blocks (IWST 2025, Gdansk, Poland)
Encoding for Objects Matters (IWST 2025)
Challenges of Transpiling Smalltalk to JavaScript
Immersive experiences: what Pharo users do!
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
Cavrois - an Organic Window Management (ESUG 2025)
Ad

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf

JQuery in Seaside