SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
jQuery
Gary
2013/9/18
• Introduction of jQuery
• Environment
• Implement of jQuery
– Use jQuery to write javascript
– Event
– AJAX
– Manipulate DOM
• Implement of jQuery UI
Introduction of jQuery
• jQuery is a multi-browser(cross browser)
JavaScript library designed to simplify the
client-side scripting of HTML
• It was released in January 2006
• Used by over 65% of the 10000 most visited
websites
Introduction of jQuery
• jQuery feature
– Free, open source software
– DOM element selections, traversal and
manipulation
– Effects and animations
– Events
– AJAX
Introduction of jQuery
• DOM(Document Object Model)
– A cross-platform and language-independent
convention for representing and interacting with
object in HTML and XML documents
– An API for HTML and XML documents
– Objects in the DOM tree may be addressed and
manipulated by using methods on the objects
Introduction of jQuery
• AJAX(Asynchronous JavaScript and XML)
– create asynchronous web applications
Introduction of jQuery
• jQuery UI
– jQuery UI is a curated set of user interface
interactions, effects, widgets, and themes built on
top of the jQuery JavaScript Library
– jQuery UI is built for designers and developers
alike
Environment
• Development Environment
• Eclipse HTML Editor
– An Eclipse plugin for HTML/JSP/XML Editing.
– It requires JDT
• http://amateras.sourceforge.jp/cgi-
bin/fswiki_en/wiki.cgi?page=EclipseHTMLEdit
or
• Install
– Put the jar into plugins directory
Environment
• Source
• Preview
Environment
• Go to http://jqueryui.com/ and download
jQuery UI
• Put the jQuery UI and your html file together
(Or you can choose not to. However, you need
to include the tag by absolute path )
Implement of jQuery Outline
• Use jQuery to write JavaScript
• Event
• AJAX
• Manipulate DOM
Implement of jQuery
• How to design our webpage?
<html>
</html>
<head>
</head>
<body>
</body>
CSS
jQuery
Structure
of
html
Implement of jQuery
• Example code
• Result
Implement of jQuery
• Event
Implement of jQuery
• bind() and trigger()
• When there is click event, call showMsg
• Custom event
• Use trigger function to send event
$('#btn').bind('click', showMsg);
$('#btn').bind(‘haha’, showMsg);
$('#btn').trigger(‘haha’);
Implement of jQuery
• AJAX
– 4 callbacks of
AJAX function
• beforeSend
• success
• error
• complete
Implement of jQuery
• AJAX event handler
– Add a loading image
– When AJAX request is sent, show loading image
<img src="spinner.gif" style="display:none" id="loading" >
$(document).ready(function(e){
$('#btn').click(showMsg);
$('#loading').ajaxStart(function(e){
$(e.target).show();
});
$('#loading').ajaxComplete(function(e){
$(e.target).hide();
});
});
Implement of jQuery
• JavaScript standard offer the following API to
access the elements in a DOM
– document.getElementById
– document.getElementByTagName
– document.getElementByName
• jQuery offers a powerful set of tools for
matching a set of elements in a document
• Full jQuery selector support can be checked
at http://api.jquery.com/category/selectors/
Implement of jQuery
• Manipulate DOM
– UI
• Result
Implement of jQuery
• Manipulate DOM
– event
Implement of jQuery
• Manipulate DOM
– Count how many rows
– jQuery.children()
– jQuery.parent()
$('#complete_button').click(function(e) {
alert("一共有 "+
$('tbody').children('tr').length + " 列資料");
});
Implement of jQuery UI
• Example code
• Result
Implement of jQuery UI
• The HTML code generated by tabs() method
Implement of jQuery UI
• Without tabs() method of jQuery UI
• Result
<script>
<!--$('#tabs').tabs();-->
</script>
Implement of jQuery UI
• Manipulation of jQuery UI
– tabs() method
• tabs(options)
• tabs(“action”, params)
– AJAX
– bind()
Implement of jQuery UI
• How can I add a tab dynamically
– The green one is tabs(options)
– The blue one is tabs(“action”, params)
• tabs(“add”, “#id”, title, index)
<script>
$(“#tabs”).tabs ({
fx : {opacity : “toggle”},
}).tabs (“add”, “#tab4”, Tab4);
</script>
Implement of jQuery UI
• AJAX
– The red one is tabs(“url”, index, url)
– The blue one is tabs(“load”, index)
<script>
$(“#tabs”).tabs ({
fx : {opacity : “toggle”},
}).tabs (“url”, 0, “haha.php”).tabs (“load”, 0);
</script>
Implement of jQuery UI
• bind()
– handle “tabsadd” after called “add”
<script>
$(“#tabs”).tabs ({
fx : {opacity : “toggle”},
}).bind (“tabsadd”, function (event, tab)
{
$(tab.panel).load (“haha.php”);
}).tabs (“add”, “#tab4”, “Tab4”);
</script>
Conclusion
• jQuery is a fast, small, and feature-rich
JavaScript library. It makes things like HTML
document traversal and manipulation, event
handling, animation, and Ajax much simpler
with an easy-to-use API that works across a
multitude of browsers. With a combination of
versatility and extensibility, jQuery has
changed the way that millions of people write
JavaScript.
Future Work
• jQuery Mobile

Contenu connexe

Tendances

Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react formYao Nien Chung
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryZeeshan Khan
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesGanesh Samarthyam
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery FundamentalsGil Fink
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesVMware Tanzu
 
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015CODE BLUE
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first stepsRenato Primavera
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Frameworkvaluebound
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state managementpriya Nithya
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced RoutingLaurent Duveau
 
스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해beom kyun choi
 

Tendances (20)

Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react form
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
jQuery
jQueryjQuery
jQuery
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutes
 
JQuery selectors
JQuery selectors JQuery selectors
JQuery selectors
 
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Framework
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
 
스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Html forms
Html formsHtml forms
Html forms
 

Similaire à JQuery UI

J query presentation
J query presentationJ query presentation
J query presentationakanksha17
 
J query presentation
J query presentationJ query presentation
J query presentationsawarkar17
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQueryGill Cleeren
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationSean Burgess
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and ModernizrJussi Pohjolainen
 
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
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do MoreRemy Sharp
 
jQuery - Chapter 1 - Introduction
 jQuery - Chapter 1 - Introduction jQuery - Chapter 1 - Introduction
jQuery - Chapter 1 - IntroductionWebStackAcademy
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009Remy Sharp
 
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 SiddiquiMuhammad Ehtisham Siddiqui
 
jQuery - Web Engineering
jQuery - Web Engineering jQuery - Web Engineering
jQuery - Web Engineering adeel990
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to JqueryGurpreet singh
 

Similaire à JQuery UI (20)

J query presentation
J query presentationJ query presentation
J query presentation
 
J query presentation
J query presentationJ query presentation
J query presentation
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQuery
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
 
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
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
J query module1
J query module1J query module1
J query module1
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
jQuery - Chapter 1 - Introduction
 jQuery - Chapter 1 - Introduction jQuery - Chapter 1 - Introduction
jQuery - Chapter 1 - Introduction
 
Jqueryppt (1)
Jqueryppt (1)Jqueryppt (1)
Jqueryppt (1)
 
J query resh
J query reshJ query resh
J query resh
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Javascript libraries
Javascript librariesJavascript libraries
Javascript libraries
 
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
 
jQuery - Web Engineering
jQuery - Web Engineering jQuery - Web Engineering
jQuery - Web Engineering
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 

Plus de Gary Yeh

Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSPGary Yeh
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsGary Yeh
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript EngineGary Yeh
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device DriverGary Yeh
 
jQuery Mobile and JavaScript
jQuery Mobile and JavaScriptjQuery Mobile and JavaScript
jQuery Mobile and JavaScriptGary Yeh
 
JQuery mobile
JQuery mobileJQuery mobile
JQuery mobileGary Yeh
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database ConnectivityGary Yeh
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvasGary Yeh
 
Git Workflow
Git WorkflowGit Workflow
Git WorkflowGary Yeh
 

Plus de Gary Yeh (10)

Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript Engine
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device Driver
 
jQuery Mobile and JavaScript
jQuery Mobile and JavaScriptjQuery Mobile and JavaScript
jQuery Mobile and JavaScript
 
JQuery mobile
JQuery mobileJQuery mobile
JQuery mobile
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 
Git Workflow
Git WorkflowGit Workflow
Git Workflow
 

Dernier

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Dernier (20)

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

JQuery UI

  • 2. • Introduction of jQuery • Environment • Implement of jQuery – Use jQuery to write javascript – Event – AJAX – Manipulate DOM • Implement of jQuery UI
  • 3. Introduction of jQuery • jQuery is a multi-browser(cross browser) JavaScript library designed to simplify the client-side scripting of HTML • It was released in January 2006 • Used by over 65% of the 10000 most visited websites
  • 4. Introduction of jQuery • jQuery feature – Free, open source software – DOM element selections, traversal and manipulation – Effects and animations – Events – AJAX
  • 5. Introduction of jQuery • DOM(Document Object Model) – A cross-platform and language-independent convention for representing and interacting with object in HTML and XML documents – An API for HTML and XML documents – Objects in the DOM tree may be addressed and manipulated by using methods on the objects
  • 6. Introduction of jQuery • AJAX(Asynchronous JavaScript and XML) – create asynchronous web applications
  • 7. Introduction of jQuery • jQuery UI – jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library – jQuery UI is built for designers and developers alike
  • 8. Environment • Development Environment • Eclipse HTML Editor – An Eclipse plugin for HTML/JSP/XML Editing. – It requires JDT • http://amateras.sourceforge.jp/cgi- bin/fswiki_en/wiki.cgi?page=EclipseHTMLEdit or • Install – Put the jar into plugins directory
  • 10. Environment • Go to http://jqueryui.com/ and download jQuery UI • Put the jQuery UI and your html file together (Or you can choose not to. However, you need to include the tag by absolute path )
  • 11. Implement of jQuery Outline • Use jQuery to write JavaScript • Event • AJAX • Manipulate DOM
  • 12. Implement of jQuery • How to design our webpage? <html> </html> <head> </head> <body> </body> CSS jQuery Structure of html
  • 13. Implement of jQuery • Example code • Result
  • 15. Implement of jQuery • bind() and trigger() • When there is click event, call showMsg • Custom event • Use trigger function to send event $('#btn').bind('click', showMsg); $('#btn').bind(‘haha’, showMsg); $('#btn').trigger(‘haha’);
  • 16. Implement of jQuery • AJAX – 4 callbacks of AJAX function • beforeSend • success • error • complete
  • 17. Implement of jQuery • AJAX event handler – Add a loading image – When AJAX request is sent, show loading image <img src="spinner.gif" style="display:none" id="loading" > $(document).ready(function(e){ $('#btn').click(showMsg); $('#loading').ajaxStart(function(e){ $(e.target).show(); }); $('#loading').ajaxComplete(function(e){ $(e.target).hide(); }); });
  • 18. Implement of jQuery • JavaScript standard offer the following API to access the elements in a DOM – document.getElementById – document.getElementByTagName – document.getElementByName • jQuery offers a powerful set of tools for matching a set of elements in a document • Full jQuery selector support can be checked at http://api.jquery.com/category/selectors/
  • 19. Implement of jQuery • Manipulate DOM – UI • Result
  • 20. Implement of jQuery • Manipulate DOM – event
  • 21. Implement of jQuery • Manipulate DOM – Count how many rows – jQuery.children() – jQuery.parent() $('#complete_button').click(function(e) { alert("一共有 "+ $('tbody').children('tr').length + " 列資料"); });
  • 22. Implement of jQuery UI • Example code • Result
  • 23. Implement of jQuery UI • The HTML code generated by tabs() method
  • 24. Implement of jQuery UI • Without tabs() method of jQuery UI • Result <script> <!--$('#tabs').tabs();--> </script>
  • 25. Implement of jQuery UI • Manipulation of jQuery UI – tabs() method • tabs(options) • tabs(“action”, params) – AJAX – bind()
  • 26. Implement of jQuery UI • How can I add a tab dynamically – The green one is tabs(options) – The blue one is tabs(“action”, params) • tabs(“add”, “#id”, title, index) <script> $(“#tabs”).tabs ({ fx : {opacity : “toggle”}, }).tabs (“add”, “#tab4”, Tab4); </script>
  • 27. Implement of jQuery UI • AJAX – The red one is tabs(“url”, index, url) – The blue one is tabs(“load”, index) <script> $(“#tabs”).tabs ({ fx : {opacity : “toggle”}, }).tabs (“url”, 0, “haha.php”).tabs (“load”, 0); </script>
  • 28. Implement of jQuery UI • bind() – handle “tabsadd” after called “add” <script> $(“#tabs”).tabs ({ fx : {opacity : “toggle”}, }).bind (“tabsadd”, function (event, tab) { $(tab.panel).load (“haha.php”); }).tabs (“add”, “#tab4”, “Tab4”); </script>
  • 29. Conclusion • jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.