SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
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'

Weitere ähnliche Inhalte

Was ist angesagt?

The Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J QueryThe Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J Query
QConLondon2008
 
Java script slideshow by karan chanana
Java script slideshow by karan chananaJava script slideshow by karan chanana
Java script slideshow by karan chanana
karan chanana
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Thomas Fuchs
 

Was ist angesagt? (20)

jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)
 
jQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersjQuery Presentation to Rails Developers
jQuery Presentation to Rails Developers
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
The Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J QueryThe Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J Query
 
The jQuery Library
The  jQuery LibraryThe  jQuery Library
The jQuery Library
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
Shibuya.js Lightning Talks
Shibuya.js Lightning TalksShibuya.js Lightning Talks
Shibuya.js Lightning Talks
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Java script slideshow by karan chanana
Java script slideshow by karan chananaJava script slideshow by karan chanana
Java script slideshow by karan chanana
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
JQuery Comprehensive Overview
JQuery Comprehensive OverviewJQuery Comprehensive Overview
JQuery Comprehensive Overview
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
 
jQuery Has Coding Standards
jQuery Has Coding StandardsjQuery Has Coding Standards
jQuery Has Coding Standards
 

Ähnlich wie jQuery for Seaside

Mume JQueryMobile Intro
Mume JQueryMobile IntroMume JQueryMobile Intro
Mume JQueryMobile Intro
Gonzalo Parra
 
20111014 mu me_j_querymobile
20111014 mu me_j_querymobile20111014 mu me_j_querymobile
20111014 mu me_j_querymobile
Erik Duval
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
Remy Sharp
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
Chris Alfano
 

Ähnlich wie jQuery for Seaside (20)

JQuery in Seaside
JQuery in SeasideJQuery in Seaside
JQuery in Seaside
 
Mume JQueryMobile Intro
Mume JQueryMobile IntroMume JQueryMobile Intro
Mume JQueryMobile Intro
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
20111014 mu me_j_querymobile
20111014 mu me_j_querymobile20111014 mu me_j_querymobile
20111014 mu me_j_querymobile
 
State of jQuery and Drupal
State of jQuery and DrupalState of jQuery and Drupal
State of jQuery and Drupal
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Javascript in Plone
Javascript in PloneJavascript in Plone
Javascript in Plone
 
Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
 
WCLA12 JavaScript
WCLA12 JavaScriptWCLA12 JavaScript
WCLA12 JavaScript
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
Overlays, Accordions & Tabs, Oh My
Overlays, Accordions & Tabs, Oh MyOverlays, Accordions & Tabs, Oh My
Overlays, Accordions & Tabs, Oh My
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
 

Mehr von Lukas Renggli

Dynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool SupportDynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool Support
Lukas Renggli
 
Seaside — Agile Software Development
Seaside — Agile Software DevelopmentSeaside — Agile Software Development
Seaside — Agile Software Development
Lukas Renggli
 
Seaside Status Message
Seaside Status MessageSeaside Status Message
Seaside Status Message
Lukas Renggli
 

Mehr von Lukas Renggli (19)

Mastering Grammars with PetitParser
Mastering Grammars with PetitParserMastering Grammars with PetitParser
Mastering Grammars with PetitParser
 
Natural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking ToolsNatural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking Tools
 
The Dynamic Language is not Enough
The Dynamic Language is not EnoughThe Dynamic Language is not Enough
The Dynamic Language is not Enough
 
Dynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool SupportDynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool Support
 
Seaside — Agile Software Development
Seaside — Agile Software DevelopmentSeaside — Agile Software Development
Seaside — Agile Software Development
 
Dynamic grammars
Dynamic grammarsDynamic grammars
Dynamic grammars
 
Domain-Specific Program Checking
Domain-Specific Program CheckingDomain-Specific Program Checking
Domain-Specific Program Checking
 
Embedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsEmbedding Languages Without Breaking Tools
Embedding Languages Without Breaking Tools
 
Language Boxes — Bending the Host Language with Modular Language Changes
Language Boxes — Bending the Host Language with Modular Language ChangesLanguage Boxes — Bending the Host Language with Modular Language Changes
Language Boxes — Bending the Host Language with Modular Language Changes
 
Seaside Status Message
Seaside Status MessageSeaside Status Message
Seaside Status Message
 
Seaside - The Revenge of Smalltalk
Seaside - The Revenge of SmalltalkSeaside - The Revenge of Smalltalk
Seaside - The Revenge of Smalltalk
 
Magritte Blitz
Magritte BlitzMagritte Blitz
Magritte Blitz
 
Seaside - On not getting bogged down
Seaside - On not getting bogged downSeaside - On not getting bogged down
Seaside - On not getting bogged down
 
Magritte
MagritteMagritte
Magritte
 
Seaside - Past, Present and Future
Seaside - Past, Present and FutureSeaside - Past, Present and Future
Seaside - Past, Present and Future
 
Magritte - A Meta-Driven Approach to Empower Developers and End Users
Magritte - A Meta-Driven Approach to Empower Developers and End UsersMagritte - A Meta-Driven Approach to Empower Developers and End Users
Magritte - A Meta-Driven Approach to Empower Developers and End Users
 
Transactional Memory for Smalltalk
Transactional Memory for SmalltalkTransactional Memory for Smalltalk
Transactional Memory for Smalltalk
 
Seaside - Web Development As You Like It
Seaside - Web Development As You Like ItSeaside - Web Development As You Like It
Seaside - Web Development As You Like It
 
5 Steps to Mastering the Art of Seaside
5 Steps to Mastering the Art of Seaside5 Steps to Mastering the Art of Seaside
5 Steps to Mastering the Art of Seaside
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

jQuery for Seaside