SlideShare une entreprise Scribd logo
1  sur  28
Client-side technologies
jQuery and Dojo
Jan Holz, Helen Magiera, Yousef Hatem, Michael Schlimnat
Web Technologies – Prof. Dr. Ulrik Schroeder – WS 2010/111
The slides are licensed under a
Creative Commons Attribution 3.0 License
PLEASE SELECT
PLAYER
Overview
1. Dojo
1. What is Dojo? Why Dojo?
2. How to get Dojo
3. Toolkit Overview
4. Dojo Demo
2. jQuery
1. What is jQuery?
2. jQuery UI
3. A quick introduction to jQuery
4. The ready() function
5. Geting started with jQuery: Examples
3. Summery/ Conclusion
Web Technologies2
1.1 What is Dojo? Why Dojo?
 JavaScript Toolkit
 Makes web development projects easy to realize
 Save time by spending less effort on the common tasks
 spend more time on the really interesting aspects of a web project
 Some further Reasons:
 Big Community
 Open source software
 Provides end-to-end solution
 Portability
Web Technologies3
1.2 How to get Dojo
 Dojo From Google CDN/AOL CDN:
Easy embedding into your website
 Dojo From Google CDN:
<script
src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"
type="text/javascript"></script>
 Dojo From AOL CDN:
<script src="http://o.aolcdn.com/dojo/1.5/dojo/dojo.xd.js"
type="text/javascript"></script>
Web Technologies4
1.3 Toolkit Overview
Web Technologies5
Dojo
DojoX UtilDijit
Base Core
1.3 Toolkit Overview
Web Technologies6
Dojo
DojoX UtilDijit
Base Core
1.3 Toolkit Overview
Web Technologies7
Dojo
Base
 included in the base-level
dojo namespace: dojo.js
 most commonly used
functions
1.3 Toolkit Overview
Web Technologies8
Dojo
Base Core
 supplements base with additional
functions
 call it with dojo.require-fuction:
dojo.require("dojo.dnd.Mover");
kinds of features:
• animation machinery: dojo.fx
• drag-and-drop facilities: dojo.dnd
• data management layer: dojo.data
• cookie handling: dojo.cookie
• back-button handling: dojo.back
• many more
1.3 Toolkit Overview
Web Technologies9
Dojo
Dijit
Base Core
 Library of widgets (short for “Dojo widget”)
 Out of the box: doesn’t require any
JavaScript at all
 Widgets created with dijit are ultra-
portable and can be shared onto any web
server
 Plugging in with dojoType inside of
ordinary html-tags
<script type="text/javascript"> dojo.require("dijit.form.Textarea");
</script>
...
<textarea id="textarea2" name="textarea2"
dojoType="dijit.form.Textarea" style="width:200px;"> Blabla
</textarea>
Divided into:
• general-purpose application widgets
(progress bars, Calendars, …)
• layout widgets (tab containers,…)
• form widgets (button, input elements,…)
1.3 Toolkit Overview
Web Technologies10
Dojo
DojoXDijit
Base Core
• Area for development of extensions to the
Dojo toolkit
• managed by subprojects (each contains
readme.txt)
1.3 Toolkit Overview
Web Technologies11
Dojo
DojoX UtilDijit
Base Core Contains JavaScript unit-testing
framework
 tool for creating custom versions
of dojo
1.3 Toolkit Overview
Web Technologies12
Dojo
DojoX UtilDijit
Base Core
1.4 Dojo Demo
 Huge API, we will introduce only a few
 Some clever wrappers for the usual old JS functions
 Drag and Drop
 Context Menus
 Collecting data from data stores
Web Technologies13
1.4 Another perspective of searching!
 Welcome to Google <3 Dojo website!
 Relies on Google search engine to get the results.
 uses Dojo to give the user a rich experience: take a sneak look at
the website, add the search result to favorites bucket, and
highlight them using different colors.
Web Technologies14
1.4 Dojo Syntactic Sugars
 Extensions to JavaScript basic functions and constructs
 Querying elements flexibly:
 dojo.query('#foo .bar > h3')
 Iteration on elements cannot be easier:
 dojo.query(“foo").forEach( function(fooTag) {fooTag.disabled =
true; } );
 Using signal-slot system to wire up the system
 dojo.connect(exampleObj, "foo", exampleObj, "bar");
Web Technologies15
1.4 Dojo – Fetching Data from a DataStore
 Dojo introduces a uniform way of accessing data.
dojo.require("dojox.data.GoogleSearchStore");
var search = new dojox.data.GoogleSearchStore();
search.fetch(
{
query: { text: queryText },
count: 20,
onComplete: callback //handles the returned data
}
);
Web Technologies16
1.4 Dojo – Fetching Data from a DataStore2
Web Technologies17
function callback(items){
//string array
var strings = new Array();
//put the results in a matrix
dojo.forEach(items, function(item){
strings.push("<b>" + search.getValue(item,
"title") + "<b><br/><a href="" +
search.getValue(item, "url") +
"">"+search.getValue(item, "url")+"</a>"); });
//now we have the data stored in strings
}
1.4. Dojo - DnD
 Dojo offers a very neat cross platform way for drag and drop
 Define a source, a destination, and Dojo will do the magic!
dojo.require("dojo.dnd.Source");
var dragList = new dojo.dnd.Source(“someNode");
var dropList = new dojo.dnd.Target(“someOtherNode");
 To add elements to the drag list, simply use insertNodes
and according the type to DOM element which the drag list is
wrapping, dojo will create the appropriate list element
Web Technologies18
1.4. Dojo – Context Menu
 Dojo offers an easy way to incorporate menus in a website
 There are so many type of menus that Dojo supports
dojo.require("dijit.Menu");
pMenu = new dijit.Menu();
pMenu.addChild(new dijit.MenuItem({label:"Menu
Item", onClick:function(){alert (“I am
hit!");}));
Web Technologies19
2.1 What is jQuery?
 JavaScript library
 makes navigating through HTML and CSS elements easier
 intuitive Event Handling functionalities
 animations
 ajax support
 Download jquery.js at jQuery.com
 include <script type="text/javascript" src="jquery.js"></script> in
the <head>
Web Technologies20
2.2 jQuery UI
 additional low-level interactions
 e.g. drag and drop and resize items
 variety of widgets
 advanced effects
 customizable download
 select which modules should be downloaded
 built on top of jQuery
Web Technologies21
2.3 A quick introduction to jQuery
 $ alias for jQuery class
 $() constructs a jQuery object (alias for jQuery())
 takes css classes and IDs, html elements and XPath expressions as
arguments
 e.g $(“.myClass”) represents .myClass
 advantage of jQuery: intuitive element selector functionality
 don't use document.getElementByID anymore
Web Technologies22
2.4 The ready() function
 Start with this:
 $(document).ready(function(){ // put your code here});
 or shorter: $(function(){ // your code});
 executes the code when DOM is constructed
 use instead of window.onload = function(){ // executed when page
is loaded}
Web Technologies23
2.5 Getting started with jQuery
Enough theory, now we...
 use a hover effect
 change "static" text in realtime
 introduce some animations
 code a small jQuery plugin
Web Technologies24
2.5 Getting started with jQuery
We have...
...a plain html/css site (bit.ly/jQdemo)
We want...
…a clean separation of functionality and structure
We need...
...the DOM for jQuery to read/manipulate it
→ $(document).ready(function() { … });
Web Technologies25
2.5 Getting started with jQuery
A glimpse of code
 $ == jQuery == window.jQuery
 $(object).someFunction();
 $(object).someFunction($(obj).prevFunction());
 $(object1).someFunction(function() {
 $(object2).nextFunction();
 });
Web Technologies26
Summary/ Conclusion
 Both are pretty fast JS-Frameworks
 Both offer almost the same functionality
 Dojo offers more fine-grained libraries (dojo.require)
→ choose the one you like best
Web Technologies27
hover with Dojo:
dojo.query("p").forEach(function(node){
node.onmouseover = function(){
dojo.addClass(node, "red");
}
node.onmouseout = function(){
dojo.removeClass(node, "red");
}
});
hover with jQuery:
$("p").hover(function() {
$(this).addClass("red");
},function(){
$(this).removeClass("red");
});
Literature
 Books: M.A. Russell – Dojo. The definitive Guide
 Tutorials: http://www.sitepen.com/blog/series/dojo-quick-start-
guide/
 Links: http://www.dojotoolkit.org
 Dojo Official Website, API Documentation:
 http://api.dojotoolkit.org/
 Dojo.Campus.org
 http://dojocampus.org/
 Practical Dojo Project, Frank W. Zammetti
 APress publications, ISBN-13 (pbk): 978-1-4302-1066-5
1 Introduction28

Contenu connexe

Tendances

01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript DevelopmentTommy Vercety
 
Intoduction on Playframework
Intoduction on PlayframeworkIntoduction on Playframework
Intoduction on PlayframeworkKnoldus Inc.
 
20131108 cs query by howard
20131108 cs query by howard20131108 cs query by howard
20131108 cs query by howardLearningTech
 
From YUI3 to K2
From YUI3 to K2From YUI3 to K2
From YUI3 to K2kaven yan
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 
Simple Web Development in Java
Simple Web Development in JavaSimple Web Development in Java
Simple Web Development in JavaVincent Tencé
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQueryAkshay Mathur
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with VaadinPeter Lehto
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Rabble .
 
Custom YUI Widgets
Custom YUI WidgetsCustom YUI Widgets
Custom YUI Widgetscyrildoussin
 
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSJavascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSMin Ming Lo
 
Testable, Object-Oriented JavaScript
Testable, Object-Oriented JavaScriptTestable, Object-Oriented JavaScript
Testable, Object-Oriented JavaScriptJon Kruger
 
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby DeveloperVenturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby DeveloperJon Kruger
 

Tendances (20)

Jquery
JqueryJquery
Jquery
 
Phactory
PhactoryPhactory
Phactory
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript Development
 
Intoduction on Playframework
Intoduction on PlayframeworkIntoduction on Playframework
Intoduction on Playframework
 
Introduction to jOOQ
Introduction to jOOQIntroduction to jOOQ
Introduction to jOOQ
 
JQuery
JQueryJQuery
JQuery
 
20131108 cs query by howard
20131108 cs query by howard20131108 cs query by howard
20131108 cs query by howard
 
From YUI3 to K2
From YUI3 to K2From YUI3 to K2
From YUI3 to K2
 
jQuery
jQueryjQuery
jQuery
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
Simple Web Development in Java
Simple Web Development in JavaSimple Web Development in Java
Simple Web Development in Java
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007
 
java script
java scriptjava script
java script
 
Custom YUI Widgets
Custom YUI WidgetsCustom YUI Widgets
Custom YUI Widgets
 
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSJavascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
 
Testable, Object-Oriented JavaScript
Testable, Object-Oriented JavaScriptTestable, Object-Oriented JavaScript
Testable, Object-Oriented JavaScript
 
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby DeveloperVenturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
 

Similaire à Jquery dojo slides

Introduction To Dojo
Introduction To DojoIntroduction To Dojo
Introduction To Dojoyoavrubin
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the CloudJames Thomas
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
How dojo works
How dojo worksHow dojo works
How dojo worksAmit Tyagi
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit Predhin Sapru
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOMDaiwei Lu
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web appsyoavrubin
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsMatteo Manchi
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Peter Martin
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryAlek Davis
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdfSudhanshiBakre1
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Libraryrsnarayanan
 

Similaire à Jquery dojo slides (20)

Introduction To Dojo
Introduction To DojoIntroduction To Dojo
Introduction To Dojo
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
How dojo works
How dojo worksHow dojo works
How dojo works
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit
 
Dojo tutorial
Dojo tutorialDojo tutorial
Dojo tutorial
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
J query
J queryJ query
J query
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdf
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 

Dernier

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 FresherRemote DBA Services
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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 AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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...Drew Madelung
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 

Dernier (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

Jquery dojo slides

  • 1. Client-side technologies jQuery and Dojo Jan Holz, Helen Magiera, Yousef Hatem, Michael Schlimnat Web Technologies – Prof. Dr. Ulrik Schroeder – WS 2010/111 The slides are licensed under a Creative Commons Attribution 3.0 License PLEASE SELECT PLAYER
  • 2. Overview 1. Dojo 1. What is Dojo? Why Dojo? 2. How to get Dojo 3. Toolkit Overview 4. Dojo Demo 2. jQuery 1. What is jQuery? 2. jQuery UI 3. A quick introduction to jQuery 4. The ready() function 5. Geting started with jQuery: Examples 3. Summery/ Conclusion Web Technologies2
  • 3. 1.1 What is Dojo? Why Dojo?  JavaScript Toolkit  Makes web development projects easy to realize  Save time by spending less effort on the common tasks  spend more time on the really interesting aspects of a web project  Some further Reasons:  Big Community  Open source software  Provides end-to-end solution  Portability Web Technologies3
  • 4. 1.2 How to get Dojo  Dojo From Google CDN/AOL CDN: Easy embedding into your website  Dojo From Google CDN: <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript"></script>  Dojo From AOL CDN: <script src="http://o.aolcdn.com/dojo/1.5/dojo/dojo.xd.js" type="text/javascript"></script> Web Technologies4
  • 5. 1.3 Toolkit Overview Web Technologies5 Dojo DojoX UtilDijit Base Core
  • 6. 1.3 Toolkit Overview Web Technologies6 Dojo DojoX UtilDijit Base Core
  • 7. 1.3 Toolkit Overview Web Technologies7 Dojo Base  included in the base-level dojo namespace: dojo.js  most commonly used functions
  • 8. 1.3 Toolkit Overview Web Technologies8 Dojo Base Core  supplements base with additional functions  call it with dojo.require-fuction: dojo.require("dojo.dnd.Mover"); kinds of features: • animation machinery: dojo.fx • drag-and-drop facilities: dojo.dnd • data management layer: dojo.data • cookie handling: dojo.cookie • back-button handling: dojo.back • many more
  • 9. 1.3 Toolkit Overview Web Technologies9 Dojo Dijit Base Core  Library of widgets (short for “Dojo widget”)  Out of the box: doesn’t require any JavaScript at all  Widgets created with dijit are ultra- portable and can be shared onto any web server  Plugging in with dojoType inside of ordinary html-tags <script type="text/javascript"> dojo.require("dijit.form.Textarea"); </script> ... <textarea id="textarea2" name="textarea2" dojoType="dijit.form.Textarea" style="width:200px;"> Blabla </textarea> Divided into: • general-purpose application widgets (progress bars, Calendars, …) • layout widgets (tab containers,…) • form widgets (button, input elements,…)
  • 10. 1.3 Toolkit Overview Web Technologies10 Dojo DojoXDijit Base Core • Area for development of extensions to the Dojo toolkit • managed by subprojects (each contains readme.txt)
  • 11. 1.3 Toolkit Overview Web Technologies11 Dojo DojoX UtilDijit Base Core Contains JavaScript unit-testing framework  tool for creating custom versions of dojo
  • 12. 1.3 Toolkit Overview Web Technologies12 Dojo DojoX UtilDijit Base Core
  • 13. 1.4 Dojo Demo  Huge API, we will introduce only a few  Some clever wrappers for the usual old JS functions  Drag and Drop  Context Menus  Collecting data from data stores Web Technologies13
  • 14. 1.4 Another perspective of searching!  Welcome to Google <3 Dojo website!  Relies on Google search engine to get the results.  uses Dojo to give the user a rich experience: take a sneak look at the website, add the search result to favorites bucket, and highlight them using different colors. Web Technologies14
  • 15. 1.4 Dojo Syntactic Sugars  Extensions to JavaScript basic functions and constructs  Querying elements flexibly:  dojo.query('#foo .bar > h3')  Iteration on elements cannot be easier:  dojo.query(“foo").forEach( function(fooTag) {fooTag.disabled = true; } );  Using signal-slot system to wire up the system  dojo.connect(exampleObj, "foo", exampleObj, "bar"); Web Technologies15
  • 16. 1.4 Dojo – Fetching Data from a DataStore  Dojo introduces a uniform way of accessing data. dojo.require("dojox.data.GoogleSearchStore"); var search = new dojox.data.GoogleSearchStore(); search.fetch( { query: { text: queryText }, count: 20, onComplete: callback //handles the returned data } ); Web Technologies16
  • 17. 1.4 Dojo – Fetching Data from a DataStore2 Web Technologies17 function callback(items){ //string array var strings = new Array(); //put the results in a matrix dojo.forEach(items, function(item){ strings.push("<b>" + search.getValue(item, "title") + "<b><br/><a href="" + search.getValue(item, "url") + "">"+search.getValue(item, "url")+"</a>"); }); //now we have the data stored in strings }
  • 18. 1.4. Dojo - DnD  Dojo offers a very neat cross platform way for drag and drop  Define a source, a destination, and Dojo will do the magic! dojo.require("dojo.dnd.Source"); var dragList = new dojo.dnd.Source(“someNode"); var dropList = new dojo.dnd.Target(“someOtherNode");  To add elements to the drag list, simply use insertNodes and according the type to DOM element which the drag list is wrapping, dojo will create the appropriate list element Web Technologies18
  • 19. 1.4. Dojo – Context Menu  Dojo offers an easy way to incorporate menus in a website  There are so many type of menus that Dojo supports dojo.require("dijit.Menu"); pMenu = new dijit.Menu(); pMenu.addChild(new dijit.MenuItem({label:"Menu Item", onClick:function(){alert (“I am hit!");})); Web Technologies19
  • 20. 2.1 What is jQuery?  JavaScript library  makes navigating through HTML and CSS elements easier  intuitive Event Handling functionalities  animations  ajax support  Download jquery.js at jQuery.com  include <script type="text/javascript" src="jquery.js"></script> in the <head> Web Technologies20
  • 21. 2.2 jQuery UI  additional low-level interactions  e.g. drag and drop and resize items  variety of widgets  advanced effects  customizable download  select which modules should be downloaded  built on top of jQuery Web Technologies21
  • 22. 2.3 A quick introduction to jQuery  $ alias for jQuery class  $() constructs a jQuery object (alias for jQuery())  takes css classes and IDs, html elements and XPath expressions as arguments  e.g $(“.myClass”) represents .myClass  advantage of jQuery: intuitive element selector functionality  don't use document.getElementByID anymore Web Technologies22
  • 23. 2.4 The ready() function  Start with this:  $(document).ready(function(){ // put your code here});  or shorter: $(function(){ // your code});  executes the code when DOM is constructed  use instead of window.onload = function(){ // executed when page is loaded} Web Technologies23
  • 24. 2.5 Getting started with jQuery Enough theory, now we...  use a hover effect  change "static" text in realtime  introduce some animations  code a small jQuery plugin Web Technologies24
  • 25. 2.5 Getting started with jQuery We have... ...a plain html/css site (bit.ly/jQdemo) We want... …a clean separation of functionality and structure We need... ...the DOM for jQuery to read/manipulate it → $(document).ready(function() { … }); Web Technologies25
  • 26. 2.5 Getting started with jQuery A glimpse of code  $ == jQuery == window.jQuery  $(object).someFunction();  $(object).someFunction($(obj).prevFunction());  $(object1).someFunction(function() {  $(object2).nextFunction();  }); Web Technologies26
  • 27. Summary/ Conclusion  Both are pretty fast JS-Frameworks  Both offer almost the same functionality  Dojo offers more fine-grained libraries (dojo.require) → choose the one you like best Web Technologies27 hover with Dojo: dojo.query("p").forEach(function(node){ node.onmouseover = function(){ dojo.addClass(node, "red"); } node.onmouseout = function(){ dojo.removeClass(node, "red"); } }); hover with jQuery: $("p").hover(function() { $(this).addClass("red"); },function(){ $(this).removeClass("red"); });
  • 28. Literature  Books: M.A. Russell – Dojo. The definitive Guide  Tutorials: http://www.sitepen.com/blog/series/dojo-quick-start- guide/  Links: http://www.dojotoolkit.org  Dojo Official Website, API Documentation:  http://api.dojotoolkit.org/  Dojo.Campus.org  http://dojocampus.org/  Practical Dojo Project, Frank W. Zammetti  APress publications, ISBN-13 (pbk): 978-1-4302-1066-5 1 Introduction28