SlideShare a Scribd company logo
Wildan Maulana | wildan [at] tobethink.com #8 jQuery:  Talk to the server with Ajax Doc. v. 0.1 - 10/03/09
This Presentation Cover ,[object Object]
Loading pre-formatted HTML from the server
Making general GET and POST requests
Making requests with fine-grained control
Setting default ajax properties
A comprehensive example
A brief overview of Ajax ,[object Object]
Brusing up an Ajax ,[object Object]
Creating an XHR instance if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } else { throw new Error("Ajax is not supported by this browser"); }
XHR Methods and Properties Methods Description abort() Causes the currently executing request to be cancelled getAllResponseHeaders() Returns a single string containing the names and values of all response headers open(method, url, async, username, password) Return the value of the named response header send(content) Initiates the requests with the specified (optional) body content setRequestHeader(name, value) Sets a request header using the specified name and value
XHR Methods and Properties Methods Description onreadystatechange Assigns the event handler used when the state of the requests change readyState ,[object Object]
1 – Loading
2 – Loaded
3 – Interactive
4 - Complete  responseText The body content returned in the response responseXML If the body content is XML, the XML DOM created from the body content status Responses status code returned from the server. For example : 200 for success or 404 for not found statusText The status text message returned by the response
Initiating the Request ,[object Object],[object Object]
Provide the URL of the server-side resource to be contacted
Let the XHR instance know how it can inform us of its progress
Provide any body content for the POST request xhr.open('GET','/some/resource/url');  -> step 1 and 2 xhr.send(null); -> step 4 if get  xhr.send('a=1&b=2&c=3'); -> step 4 if post
Keeping track of progress ,[object Object],xhr.onreadystatechange = function() { if (xhr.readyState == 4) { if (xhr.status >= 200 && xhr.status < 300) { //success }  else { //error  }  } } Ignores all but cempleted state Branches on responses status Executes on success Executes on failure
Getting the response ,[object Object]
The lifecycle of an Ajax
Pain Points that page authors using Ajax  need to deal with ,[object Object]
Ready handlers need to sift through a lot of uninteresting state changes.
Ready handlers don’t automatically get a reference to invoking XHR
instances.
The response body needs to be dealt with in numerous ways depending
upon its format.
Loading Content into elements ,[object Object],var xhr; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { xhr = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;); } else { throw new Error(&quot;Ajax is not supported by this browser&quot;); } xhr.onreadystatechange = function() { if (xhr.readyState == 4) { if (xhr.status >= 200 && xhr.status < 300) { document.getElementById('someContainer') .innerHTML = xhr.responseText; } } } xhr.open('GET','/serverResource'); xhr.send();
 
Loading Content with jQuery ,[object Object],load(url, parameters, callback) Initiates an Ajax request to the specified URL with optional parameters. A callback function can be specified that’s invoked when the request completes. The response text replaces the content of all matched elements. Parameters url (String) The URL of the server-side resource to which the request is sent. parameters (Object) An object whose properties are serialized into properly encoded parameters to be passed to the request. If specified, the request is made using the POST method. If omitted, the GET method is used. callback (Function) A callback function invoked after the response data has been loaded into the elements of the matched set. The parameters passed to this function are the response text, the status code, and the XHR instance. Returns The wrapped set
Filtering Response ,[object Object]
by the selector.
For example, to filter response elements so that only <div> instances are injected, we write : ,[object Object]
If the Request come from form control serialize() Creates a properly formatted and encoded query string from all successful form elements in the wrapped set. Parameters none Returns The formatted query string The serialize() method gather data in a query string, if we want get data in a  JavaScript array, jQuery provides serializeArray() method described next ...
Get the form data in a JavaScript array serializeArray() Collects the values of all successful form controls into an array of objects containing the names and values of the controls Parameters none Returns The formatted query string
Loading dynamic inventory data
The HTML Markup <body id=&quot;bootCloset1&quot;> <img id=&quot;banner&quot; src=&quot;boot.closet.branding.png&quot;/> <form action=&quot;&quot; id=&quot;orderForm&quot;> <div id=&quot;detailFormContainer&quot;> <h1>Choose your boots</h1> <div> <label>Please choose a style:</label><br/> <select id=&quot;styleDropdown&quot;> <option value=&quot;&quot;>Please choose a boot style</option> <option value=&quot;7177382&quot;>Caterpillar Tradesman Work Boot</option> <option value=&quot;7269643&quot;>Caterpillar Logger Boot</option> <option value=&quot;7141832&quot;>Chippewa 17&quot; Engineer Boot</option> <option value=&quot;7141833&quot;>Chippewa 17&quot; Snakeproof Boot</option> <option value=&quot;7173656&quot;>Chippewa 11&quot; Engineer Boot</option> <option value=&quot;7141922&quot;>Chippewa Harness Boot</option> <option value=&quot;7141730&quot;>Danner Foreman Pro Work Boot</option> <option value=&quot;7257914&quot;>Danner Grouse GTX Boot</option> </select> </div> <div id=&quot;detailsDisplay&quot;></div> </div> </form> </body> s Empty <div>
JQuery in Action $(function(){ $('#styleDropdown') .change(function(){ var styleValue = $(this).val(); $('#detailsDisplay').load( 'getDetails.jsp', { style: styleValue } ); }) .change(); }); Wraps style dropdown and binds change handler Loads data for  selected style Trigers change handler
The server-side resource returns a pre-formatted fragment of  HTML to display the boot information.
Making GET and POST requests ,[object Object]
POST requests—Can be non-idempotent; the data they send to the server can be used to change the model state of the application; for example, adding records to a database or removing information from the server.
Getting data with jQuery $.get(url,parameters,callback) ,[object Object],Parameters url (String) The URL of the server-side resource to contact via the GET method. parameters (Object|String) An object whose properties serve as the name/value pairs used to construct a query string to be appended to the URL, or a preformatted and encoded query string. callback (Function) A function invoked when the request completes. The response callback body is passed as the first parameter to this callback, and the status as the second. Returns The XHR instance
$.get() example <html> <head> <title>$.get() Example</title> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../common.css&quot;> <script type=&quot;text/javascript&quot; src=&quot;../scripts/jquery-1.2.1.js&quot;></script> <script type=&quot;text/javascript&quot;> $(function(){ $('#testButton').click(function(){ $.get( 'reflectData.jsp', {a:1, b:2, c:3}, function(data) { alert(data); } ); }); }); </script> </head> <body> <button type=&quot;button&quot; id=&quot;testButton&quot;>   Click me!</button> </body> </html> Gets data from server
Getting JSON data : $.getJSON $.get(url,parameters,callback) ,[object Object],Parameters url (String) The URL of the server-side resource to contact via the GET method. parameters (Object|String) An object whose properties serve as the name/value pairs used to construct a query string to be appended to the URL, or a preformatted and encoded query string. callback (Function) A function invoked when the request completes. The data value resulting from digesting the response body as a JSON string is passed as the first parameter to this callback, and the status as the second. Returns The XHR instance
Loading cascading dropdowns The initial state of the order form with the dependent dropdowns in an empty and disabled state
<body id=&quot; bootCloset2 &quot;> <img id=&quot;banner&quot; src=&quot;boot.closet.branding.png&quot;/> <form action=&quot;&quot; id=&quot;orderForm&quot;> <div id=&quot;detailFormContainer&quot;> <h1>Choose your boots</h1> <div id=&quot;cascadingDropdowns&quot;> <div> <label>Please choose a style:</label><br/> <select id=&quot;styleDropdown&quot;> <option value=&quot;&quot;>Please choose a boot style</option> <option value=&quot;7177382&quot;> Caterpillar Tradesman Work Boot</option> <option value=&quot;7269643&quot;>Caterpillar Logger Boot</option> <option value=&quot;7141832&quot;>Chippewa 17&quot; Engineer Boot</option> <option value=&quot;7141833&quot;>Chippewa 17&quot; Snakeproof Boot</option> <option value=&quot;7173656&quot;>Chippewa 11&quot; Engineer Boot</option> <option value=&quot;7141922&quot;>Chippewa Harness Boot</option> <option value=&quot;7141730&quot;>Danner Foreman Pro Work Boot</option> <option value=&quot;7257914&quot;>Danner Grouse GTX Boot</option> </select> </div> <div> <label>Color:</label><br/> <select id=&quot;colorDropdown&quot; disabled=&quot;disabled&quot;></select> </div> <div> <label>Size:</label><br/> <select id=&quot;sizeDropdown&quot; disabled=&quot;disabled&quot;></select> </div> </div> <div id=&quot;detailsDisplay&quot;></div> </div> </form> </body>
The New Ready Handler $(function(){ $('#styleDropdown') .change(function(){ var styleValue = $(this).val(); $('#detailsDisplay').load( 'getDetails.jsp', { style: styleValue }  ); adjustColorDropdown(); }) .change(); $('#colorDropdown') .change(adjustSizeDropdown); }); Triggers state adjusments of color dropdown
adjustColorDropdown() [ {value:'',caption:'choose color'}, {value:'bk',caption:'Black Oil-tanned'}, {value:'br',caption:'Black Polishable'} ] function adjustColorDropdown() { var styleValue = $('#styleDropdown').val(); var dropdownSet = $('#colorDropdown'); if (styleValue.length == 0) { dropdownSet.attr(&quot;disabled&quot;,true); $(dropdownSet).emptySelect(); adjustSizeDropdown(); } else { dropdownSet.attr(&quot;disabled&quot;,false); $.getJSON( 'getColors.jsp', {style:styleValue}, function(data){ $(dropdownSet).loadSelect(data); adjustSizeDropdown();  }  ); } } Enables or disables the color dropdown Empties disabled dropdown and clears dependent drop down Gets color values based on style Triggers adjusments of dependent dropdown We will create this function later .. @_@ A typical JSON construct returned from getColors.jsp
adjustSizeDropdown() function adjustSizeDropdown() { var styleValue = $('#styleDropdown').val(); var colorValue = $('#colorDropdown').val(); var dropdownSet = $('#sizeDropdown'); if ((styleValue.length == 0)||(colorValue.length == 0) ) { dropdownSet.attr(&quot;disabled&quot;,true); $(dropdownSet).emptySelect(); }else { dropdownSet.attr(&quot;disabled&quot;,false); $.getJSON( 'getSizes.jsp', {style:styleValue,color:colorValue}, function(data){$(dropdownSet).loadSelect(data)} ); } }
The Results
Writing the custom commands emptySelect() : $.fn.emptySelect = function() { return this.each(function(){ if (this.tagName=='SELECT') this.options.length = 0; }); } loadSelect() : $.fn.loadSelect = function(optionsDataArray) { return this.emptySelect().each(function(){ if (this.tagName=='SELECT') { var selectElement = this; $.each(optionsDataArray,function(index,optionData){ var option = new Option(optionData.caption, optionData.value); if ($.browser.msie) { selectElement.add(option); } else { selectElement.add(option,null); } }); } }); }
The Implementation of our custom select command (function($) { $.fn.emptySelect = function() { return this.each(function(){ if (this.tagName=='SELECT') this.options.length = 0; }); } $.fn.loadSelect = function(optionsDataArray) { return this.emptySelect().each(function(){ if (this.tagName=='SELECT') { var selectElement = this; $.each(optionsDataArray,function(index,optionData){ var option = new Option(optionData.caption, optionData.value); if ($.browser.msie) { selectElement.add(option); } else { selectElement.add(option,null); } }); } }); } })(jQuery);
GET is not enough ! Between  $.get()  and  $.getJSON() , jQuery gives us some powerful tools when it comes to making GET requests, but man does not live by GETs alone!
Making POST request : $.post $.post(url,parameters,callback) ,[object Object],Parameters url (String) The URL of the server-side resource to contact via the POST method. parameters (Object|String) An object whose properties serve as the name/value pairs parameters used to construct the body of the request, or a preformatted and encoded query string. callback ,[object Object],Returns The XHR instance
Taking full control of an Ajax request ,[object Object]

More Related Content

What's hot

Ajax
AjaxAjax
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaJevgeni Kabanov
 
JPA 2.0
JPA 2.0JPA 2.0
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Knoldus Inc.
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
seleciii44
 
Ajax
AjaxAjax
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
Hitesh Mohapatra
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servletvikram singh
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsBG Java EE Course
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
Hitesh Mohapatra
 
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Corley S.r.l.
 
Jstl Guide
Jstl GuideJstl Guide
Jstl Guide
Yuval Zilberstein
 
ERRest in Depth
ERRest in DepthERRest in Depth
ERRest in Depth
WO Community
 
ERRest - Designing a good REST service
ERRest - Designing a good REST serviceERRest - Designing a good REST service
ERRest - Designing a good REST service
WO Community
 
AJAX Transport Layer
AJAX Transport LayerAJAX Transport Layer
AJAX Transport Layer
Siarhei Barysiuk
 
JSON
JSONJSON
JSON
Yoga Raja
 

What's hot (20)

Servlet11
Servlet11Servlet11
Servlet11
 
Ajax
AjaxAjax
Ajax
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
 
JPA 2.0
JPA 2.0JPA 2.0
JPA 2.0
 
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
Ajax
AjaxAjax
Ajax
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servlet
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
 
Middleware PHP - A simple micro-framework
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
 
Jstl Guide
Jstl GuideJstl Guide
Jstl Guide
 
Jstl 8
Jstl 8Jstl 8
Jstl 8
 
Basic JSTL
Basic JSTLBasic JSTL
Basic JSTL
 
Jquery 4
Jquery 4Jquery 4
Jquery 4
 
ERRest in Depth
ERRest in DepthERRest in Depth
ERRest in Depth
 
ERRest - Designing a good REST service
ERRest - Designing a good REST serviceERRest - Designing a good REST service
ERRest - Designing a good REST service
 
AJAX Transport Layer
AJAX Transport LayerAJAX Transport Layer
AJAX Transport Layer
 
JSON
JSONJSON
JSON
 

Viewers also liked

Ajax
AjaxAjax
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RWOpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RWWildan Maulana
 
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsPostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsWildan Maulana
 
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...Wildan Maulana
 
Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Wildan Maulana
 
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonKetahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Wildan Maulana
 
ICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi ArsipICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi ArsipWildan Maulana
 

Viewers also liked (7)

Ajax
AjaxAjax
Ajax
 
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RWOpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
OpenThink Labs Workshop : Ketahanan Pangan Skala RT/RW
 
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyToolsPostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
PostgreSQL BootCamp : Manajemen Master Data dengan SkyTools
 
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
OpenThink Labs : Dengar Pendapat Komunitas ciliwung dengan kemen pu dan kemen...
 
Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014Pengembangan OpenThink SAS 2013-2014
Pengembangan OpenThink SAS 2013-2014
 
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam MelonKetahanan Pangan #1 : Gerakan Sekolah Menanam Melon
Ketahanan Pangan #1 : Gerakan Sekolah Menanam Melon
 
ICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi ArsipICA – AtoM : Retensi Arsip
ICA – AtoM : Retensi Arsip
 

Similar to jQuery : Talk to server with Ajax

AJAX
AJAXAJAX
AJAX
AJAXAJAX
Implementing Ajax In ColdFusion 7
Implementing Ajax In ColdFusion 7Implementing Ajax In ColdFusion 7
Implementing Ajax In ColdFusion 7
Pranav Prakash
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
Pamela Fox
 
jQuery - Chapter 5 - Ajax
jQuery - Chapter 5 -  AjaxjQuery - Chapter 5 -  Ajax
jQuery - Chapter 5 - Ajax
WebStackAcademy
 
AJAX.pptx
AJAX.pptxAJAX.pptx
AJAX.pptx
ssuser0a07a1
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applicationsdominion
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
Adnan Sohail
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
Oliver Cai
 
Ajax
AjaxAjax
Unit-5.pptx
Unit-5.pptxUnit-5.pptx
Unit-5.pptx
itzkuu01
 
Core Java tutorial at Unit Nexus
Core Java tutorial at Unit NexusCore Java tutorial at Unit Nexus
Core Java tutorial at Unit Nexus
Unit Nexus Pvt. Ltd.
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
engcs2008
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
WebStackAcademy
 
Struts2
Struts2Struts2
Struts2
yuvalb
 
Ajax and xml
Ajax and xmlAjax and xml
Ajax and xml
sawsan slii
 

Similar to jQuery : Talk to server with Ajax (20)

AJAX
AJAXAJAX
AJAX
 
AJAX
AJAXAJAX
AJAX
 
Implementing Ajax In ColdFusion 7
Implementing Ajax In ColdFusion 7Implementing Ajax In ColdFusion 7
Implementing Ajax In ColdFusion 7
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
jQuery - Chapter 5 - Ajax
jQuery - Chapter 5 -  AjaxjQuery - Chapter 5 -  Ajax
jQuery - Chapter 5 - Ajax
 
Ajax
AjaxAjax
Ajax
 
AJAX.pptx
AJAX.pptxAJAX.pptx
AJAX.pptx
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
Ajax
AjaxAjax
Ajax
 
Unit-5.pptx
Unit-5.pptxUnit-5.pptx
Unit-5.pptx
 
Core Java tutorial at Unit Nexus
Core Java tutorial at Unit NexusCore Java tutorial at Unit Nexus
Core Java tutorial at Unit Nexus
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Ajax
AjaxAjax
Ajax
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 
Struts2
Struts2Struts2
Struts2
 
Ajax and xml
Ajax and xmlAjax and xml
Ajax and xml
 

More from Wildan Maulana

Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018
Wildan Maulana
 
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Wildan Maulana
 
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...Wildan Maulana
 
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpMensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpWildan Maulana
 
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity ProviderKonfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity ProviderWildan Maulana
 
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Wildan Maulana
 
Instalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpInstalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpWildan Maulana
 
River Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationRiver Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationWildan Maulana
 
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Wildan Maulana
 
Penilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarPenilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarWildan Maulana
 
Statistik Listrik
Statistik ListrikStatistik Listrik
Statistik Listrik
Wildan Maulana
 
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesProyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesWildan Maulana
 
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaOpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaWildan Maulana
 
Menggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingMenggunakan AlisJK : Equating
Menggunakan AlisJK : Equating
Wildan Maulana
 
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)Wildan Maulana
 
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012Wildan Maulana
 
Master Plan Portal Universitas Negeri Pelangi
Master Plan Portal Universitas Negeri PelangiMaster Plan Portal Universitas Negeri Pelangi
Master Plan Portal Universitas Negeri PelangiWildan Maulana
 
Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...
Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...
Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...Wildan Maulana
 
Koperasi NP : Indonesia Mandiri, Maju, Adil dan Makmur
Koperasi NP : Indonesia Mandiri, Maju, Adil dan MakmurKoperasi NP : Indonesia Mandiri, Maju, Adil dan Makmur
Koperasi NP : Indonesia Mandiri, Maju, Adil dan MakmurWildan Maulana
 
Masterplan Portal Yayasan Dian Didaktika
Masterplan Portal Yayasan Dian DidaktikaMasterplan Portal Yayasan Dian Didaktika
Masterplan Portal Yayasan Dian DidaktikaWildan Maulana
 

More from Wildan Maulana (20)

Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018Hasil Pendataan Potensi Desa 2018
Hasil Pendataan Potensi Desa 2018
 
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
Double for Nothing? Experimental Evidence on an Unconditional TeacherSalary I...
 
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...Mensetup Google Apps sebagai IdP jenis openID  dan Aplikasi Berbasis CakePHP ...
Mensetup Google Apps sebagai IdP jenis openID dan Aplikasi Berbasis CakePHP ...
 
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai SpMensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
Mensetup Google Apps sebagai IdP jenis openID dan Wordpress sebagai Sp
 
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity ProviderKonfigurasi simpleSAMLphp  dengan Google Apps Sebagai Identity Provider
Konfigurasi simpleSAMLphp dengan Google Apps Sebagai Identity Provider
 
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
Instalasi simpleSAMLphp sebagai Identity Provider (IdP)
 
Instalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphpInstalasi dan Konfigurasi simpleSAMLphp
Instalasi dan Konfigurasi simpleSAMLphp
 
River Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River RestorationRiver Restoration in Asia and Connection Between IWRM and River Restoration
River Restoration in Asia and Connection Between IWRM and River Restoration
 
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...Optimasi Limpasan Air Limbah  Ke Kali Surabaya (Segmen Sepanjang – Jagir)  De...
Optimasi Limpasan Air Limbah Ke Kali Surabaya (Segmen Sepanjang – Jagir) De...
 
Penilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan DasarPenilaian Siswa di Finlandia - Pendidikan Dasar
Penilaian Siswa di Finlandia - Pendidikan Dasar
 
Statistik Listrik
Statistik ListrikStatistik Listrik
Statistik Listrik
 
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and UsesProyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
Proyek Al-'Alaq : Electric Bicycles ; History, Characteristics, and Uses
 
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang TuaOpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
OpenThink SAS : Interaksi Antara Sekolah, Wali Kelas, Siswa dan Orang Tua
 
Menggunakan AlisJK : Equating
Menggunakan AlisJK : EquatingMenggunakan AlisJK : Equating
Menggunakan AlisJK : Equating
 
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
Menggunakan AlisJK (Analisis Lembar Jawaban Kompuer/Analisis Item Soal)
 
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
Perkembangan OpenThink SAS a.k.a SIMMSIT, 2011-2012
 
Master Plan Portal Universitas Negeri Pelangi
Master Plan Portal Universitas Negeri PelangiMaster Plan Portal Universitas Negeri Pelangi
Master Plan Portal Universitas Negeri Pelangi
 
Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...
Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...
Koperasi NP : Program Penanggulangan Kemiskinan Kabinet Indonesia Bersatu II ...
 
Koperasi NP : Indonesia Mandiri, Maju, Adil dan Makmur
Koperasi NP : Indonesia Mandiri, Maju, Adil dan MakmurKoperasi NP : Indonesia Mandiri, Maju, Adil dan Makmur
Koperasi NP : Indonesia Mandiri, Maju, Adil dan Makmur
 
Masterplan Portal Yayasan Dian Didaktika
Masterplan Portal Yayasan Dian DidaktikaMasterplan Portal Yayasan Dian Didaktika
Masterplan Portal Yayasan Dian Didaktika
 

Recently uploaded

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

jQuery : Talk to server with Ajax

  • 1. Wildan Maulana | wildan [at] tobethink.com #8 jQuery: Talk to the server with Ajax Doc. v. 0.1 - 10/03/09
  • 2.
  • 3. Loading pre-formatted HTML from the server
  • 4. Making general GET and POST requests
  • 5. Making requests with fine-grained control
  • 6. Setting default ajax properties
  • 8.
  • 9.
  • 10. Creating an XHR instance if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { xhr = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;); } else { throw new Error(&quot;Ajax is not supported by this browser&quot;); }
  • 11. XHR Methods and Properties Methods Description abort() Causes the currently executing request to be cancelled getAllResponseHeaders() Returns a single string containing the names and values of all response headers open(method, url, async, username, password) Return the value of the named response header send(content) Initiates the requests with the specified (optional) body content setRequestHeader(name, value) Sets a request header using the specified name and value
  • 12.
  • 16. 4 - Complete responseText The body content returned in the response responseXML If the body content is XML, the XML DOM created from the body content status Responses status code returned from the server. For example : 200 for success or 404 for not found statusText The status text message returned by the response
  • 17.
  • 18. Provide the URL of the server-side resource to be contacted
  • 19. Let the XHR instance know how it can inform us of its progress
  • 20. Provide any body content for the POST request xhr.open('GET','/some/resource/url'); -> step 1 and 2 xhr.send(null); -> step 4 if get xhr.send('a=1&b=2&c=3'); -> step 4 if post
  • 21.
  • 22.
  • 23. The lifecycle of an Ajax
  • 24.
  • 25. Ready handlers need to sift through a lot of uninteresting state changes.
  • 26. Ready handlers don’t automatically get a reference to invoking XHR
  • 28. The response body needs to be dealt with in numerous ways depending
  • 30.
  • 31.  
  • 32.
  • 33.
  • 35.
  • 36. If the Request come from form control serialize() Creates a properly formatted and encoded query string from all successful form elements in the wrapped set. Parameters none Returns The formatted query string The serialize() method gather data in a query string, if we want get data in a JavaScript array, jQuery provides serializeArray() method described next ...
  • 37. Get the form data in a JavaScript array serializeArray() Collects the values of all successful form controls into an array of objects containing the names and values of the controls Parameters none Returns The formatted query string
  • 39. The HTML Markup <body id=&quot;bootCloset1&quot;> <img id=&quot;banner&quot; src=&quot;boot.closet.branding.png&quot;/> <form action=&quot;&quot; id=&quot;orderForm&quot;> <div id=&quot;detailFormContainer&quot;> <h1>Choose your boots</h1> <div> <label>Please choose a style:</label><br/> <select id=&quot;styleDropdown&quot;> <option value=&quot;&quot;>Please choose a boot style</option> <option value=&quot;7177382&quot;>Caterpillar Tradesman Work Boot</option> <option value=&quot;7269643&quot;>Caterpillar Logger Boot</option> <option value=&quot;7141832&quot;>Chippewa 17&quot; Engineer Boot</option> <option value=&quot;7141833&quot;>Chippewa 17&quot; Snakeproof Boot</option> <option value=&quot;7173656&quot;>Chippewa 11&quot; Engineer Boot</option> <option value=&quot;7141922&quot;>Chippewa Harness Boot</option> <option value=&quot;7141730&quot;>Danner Foreman Pro Work Boot</option> <option value=&quot;7257914&quot;>Danner Grouse GTX Boot</option> </select> </div> <div id=&quot;detailsDisplay&quot;></div> </div> </form> </body> s Empty <div>
  • 40. JQuery in Action $(function(){ $('#styleDropdown') .change(function(){ var styleValue = $(this).val(); $('#detailsDisplay').load( 'getDetails.jsp', { style: styleValue } ); }) .change(); }); Wraps style dropdown and binds change handler Loads data for selected style Trigers change handler
  • 41. The server-side resource returns a pre-formatted fragment of HTML to display the boot information.
  • 42.
  • 43. POST requests—Can be non-idempotent; the data they send to the server can be used to change the model state of the application; for example, adding records to a database or removing information from the server.
  • 44.
  • 45. $.get() example <html> <head> <title>$.get() Example</title> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../common.css&quot;> <script type=&quot;text/javascript&quot; src=&quot;../scripts/jquery-1.2.1.js&quot;></script> <script type=&quot;text/javascript&quot;> $(function(){ $('#testButton').click(function(){ $.get( 'reflectData.jsp', {a:1, b:2, c:3}, function(data) { alert(data); } ); }); }); </script> </head> <body> <button type=&quot;button&quot; id=&quot;testButton&quot;> Click me!</button> </body> </html> Gets data from server
  • 46.
  • 47. Loading cascading dropdowns The initial state of the order form with the dependent dropdowns in an empty and disabled state
  • 48. <body id=&quot; bootCloset2 &quot;> <img id=&quot;banner&quot; src=&quot;boot.closet.branding.png&quot;/> <form action=&quot;&quot; id=&quot;orderForm&quot;> <div id=&quot;detailFormContainer&quot;> <h1>Choose your boots</h1> <div id=&quot;cascadingDropdowns&quot;> <div> <label>Please choose a style:</label><br/> <select id=&quot;styleDropdown&quot;> <option value=&quot;&quot;>Please choose a boot style</option> <option value=&quot;7177382&quot;> Caterpillar Tradesman Work Boot</option> <option value=&quot;7269643&quot;>Caterpillar Logger Boot</option> <option value=&quot;7141832&quot;>Chippewa 17&quot; Engineer Boot</option> <option value=&quot;7141833&quot;>Chippewa 17&quot; Snakeproof Boot</option> <option value=&quot;7173656&quot;>Chippewa 11&quot; Engineer Boot</option> <option value=&quot;7141922&quot;>Chippewa Harness Boot</option> <option value=&quot;7141730&quot;>Danner Foreman Pro Work Boot</option> <option value=&quot;7257914&quot;>Danner Grouse GTX Boot</option> </select> </div> <div> <label>Color:</label><br/> <select id=&quot;colorDropdown&quot; disabled=&quot;disabled&quot;></select> </div> <div> <label>Size:</label><br/> <select id=&quot;sizeDropdown&quot; disabled=&quot;disabled&quot;></select> </div> </div> <div id=&quot;detailsDisplay&quot;></div> </div> </form> </body>
  • 49. The New Ready Handler $(function(){ $('#styleDropdown') .change(function(){ var styleValue = $(this).val(); $('#detailsDisplay').load( 'getDetails.jsp', { style: styleValue } ); adjustColorDropdown(); }) .change(); $('#colorDropdown') .change(adjustSizeDropdown); }); Triggers state adjusments of color dropdown
  • 50. adjustColorDropdown() [ {value:'',caption:'choose color'}, {value:'bk',caption:'Black Oil-tanned'}, {value:'br',caption:'Black Polishable'} ] function adjustColorDropdown() { var styleValue = $('#styleDropdown').val(); var dropdownSet = $('#colorDropdown'); if (styleValue.length == 0) { dropdownSet.attr(&quot;disabled&quot;,true); $(dropdownSet).emptySelect(); adjustSizeDropdown(); } else { dropdownSet.attr(&quot;disabled&quot;,false); $.getJSON( 'getColors.jsp', {style:styleValue}, function(data){ $(dropdownSet).loadSelect(data); adjustSizeDropdown(); } ); } } Enables or disables the color dropdown Empties disabled dropdown and clears dependent drop down Gets color values based on style Triggers adjusments of dependent dropdown We will create this function later .. @_@ A typical JSON construct returned from getColors.jsp
  • 51. adjustSizeDropdown() function adjustSizeDropdown() { var styleValue = $('#styleDropdown').val(); var colorValue = $('#colorDropdown').val(); var dropdownSet = $('#sizeDropdown'); if ((styleValue.length == 0)||(colorValue.length == 0) ) { dropdownSet.attr(&quot;disabled&quot;,true); $(dropdownSet).emptySelect(); }else { dropdownSet.attr(&quot;disabled&quot;,false); $.getJSON( 'getSizes.jsp', {style:styleValue,color:colorValue}, function(data){$(dropdownSet).loadSelect(data)} ); } }
  • 53. Writing the custom commands emptySelect() : $.fn.emptySelect = function() { return this.each(function(){ if (this.tagName=='SELECT') this.options.length = 0; }); } loadSelect() : $.fn.loadSelect = function(optionsDataArray) { return this.emptySelect().each(function(){ if (this.tagName=='SELECT') { var selectElement = this; $.each(optionsDataArray,function(index,optionData){ var option = new Option(optionData.caption, optionData.value); if ($.browser.msie) { selectElement.add(option); } else { selectElement.add(option,null); } }); } }); }
  • 54. The Implementation of our custom select command (function($) { $.fn.emptySelect = function() { return this.each(function(){ if (this.tagName=='SELECT') this.options.length = 0; }); } $.fn.loadSelect = function(optionsDataArray) { return this.emptySelect().each(function(){ if (this.tagName=='SELECT') { var selectElement = this; $.each(optionsDataArray,function(index,optionData){ var option = new Option(optionData.caption, optionData.value); if ($.browser.msie) { selectElement.add(option); } else { selectElement.add(option,null); } }); } }); } })(jQuery);
  • 55. GET is not enough ! Between $.get() and $.getJSON() , jQuery gives us some powerful tools when it comes to making GET requests, but man does not live by GETs alone!
  • 56.
  • 57.
  • 58.
  • 59. Under the covers, all other jQuery features that make Ajax requests eventually use this function to initiate the request Command syntax : $.ajax $.ajax(options) Initiates an Ajax request using the passed options to control how the request is made and callbacks notified. Parameters options (Object) An object instance whose properties define the parameters to this operation. See next slide for details. Returns The XHR instance.
  • 60. Options for the $.ajax() utility function Name Type Utility url String The URL for the request type String The HTTP method to use. Usually either POST or GET. If omitted, the defaultis GET. data Object An object whose properties serve as the query parameters to be passed to the request. If the request is a GET, this data is passed as the query string. If a POST, the data is passed as the request body. In either case, the encoding of the values is handled by the $.ajax() utility function.
  • 61.
  • 62. json—The response text is evaluated as a JSON string, and the resulting object is passed to the callbacks.
  • 63. jsonp—Similar to json except that remote scripting is allowed,assuming the remote server supports it.
  • 64.
  • 65.
  • 66.
  • 67. Options for the $.ajax() utility function Name Type Utility beforeSend Function A function invoked prior to initiating the request. This function is passed the XHR instance and can be used to set custom headers or to perform other pre-request operations. async Boolean If specified as false, the request is submitted as a synchronous request, By default, the request is asynchronous processData Boolean If set to false, prevents the data passed from being processed into URL-encoded format. By default, the data is URL-encoded into a format suitable for use with requests of type application/x-www-form-urlencoded. ifModified Boolean If true, allows a request to succeed only if the response content has not changed since the last request according to the Last-Modified header. If omitted, no header check is performed.
  • 68.
  • 69.
  • 70. Global Functions Command syntax: Ajax global functions ajaxStart(callback) ajaxSend(callback) ajaxSuccess(callback) ajaxError(callback) ajaxComplete(callback) ajaxStop(callback) Attaches the passed function to all matched elements invoked when the specified point in the processing of an Ajax request takes place. Parameters callback (Function) The callback function to be attached. See next slied for information on when the callback is invoked and what parameters it will be passed. Returns The wrapped set.
  • 71.
  • 73.
  • 75. The properties used by the $.ajax() function
  • 76.
  • 78. The properties used by the $.ajax() function
  • 79.
  • 81.
  • 83. The HTML <body> <fieldset> <legend>Initiate Ajax Requests</legend> <div> <button type=&quot;button&quot; id=&quot;goodButton&quot;> Initiate successful request </button> <button type=&quot;button&quot; id=&quot;badButton&quot;> Initiate failed request </button> </div> </fieldset> <fieldset> <legend>Success display</legend> <div id=&quot;successDisplay&quot;></div> </fieldset> <fieldset> <legend>Error display</legend> <div id=&quot;errorDisplay&quot;></div> </fieldset> </body>
  • 84.
  • 85. Establish a global function as a success listener attached to the success area
  • 86. Establish a global function as a failure listener attached to the error area
  • 87. The Handlers $('#goodButton').click(function(){ $.get('reflectData.jsp'); }); $('#badButton').click(function(){ $.get('returnError.jsp'); }); $('#successDisplay').ajaxSuccess(function(info){ $(info.target) .append('<div>Success at '+new Date()+'</div>'); }); $('#errorDisplay').ajaxError(function(info,xhr){ $(info.target) .append('<div>Failed at '+new Date()+'</div>') .append('<div>Status: ' + xhr.status + ' ' + xhr.statusText+'</div>'); });
  • 88.  
  • 89. Putting it all together
  • 90. (function($) { $.fn.termifier = function(options) { options = $.extend({ lookupResource: 'getTerm', flyoutClass: 'lookerUpperFlyout' },options||{}); this.attr('title','Click me for my definition!'); return this.click(function(event){ $.ajax({ url: options.lookupResource, type: 'get', data: {term: this.innerHTML}, dataType: 'html', success: function(data) { $('<div></div>') .css({ position: 'absolute', left: event.pageX, top: event.pageY, cursor: 'pointer', display: 'none' }) .html(data) .addClass(options.flyoutClass) .click(function(){ $(this).fadeOut(1500,function(){$(this).remove();}); }) .appendTo('body') .fadeIn(); } }); return false; }); } })(jQuery); Implementation of termifier() Not Finished Yet ...
  • 91. Q&A
  • 92.