JQuery JSON Tutorial Videos for Beginner - PowerPoint PPT Presentation

About This Presentation
Title:

JQuery JSON Tutorial Videos for Beginner

Description:

Jquery JSON tutorial helps you to acquire good knowledge on JavaScript object nation(JSON) concepts like JSON MIME Types, Parsing text to JSON format,GetJSON Method and Rendering it's Response, AJAX based submitting form data in JSON format, Implementation of getJSON Methods, JSON Call Back Functions.. – PowerPoint PPT presentation

Number of Views:96

less

Transcript and Presenter's Notes

Title: JQuery JSON Tutorial Videos for Beginner


1
CATCH EXPERTS
https//www.catchexperts.com
http//www.courseing.com
2
JQuery JSON Tutorial Videos for Beginner by
3
Highlights
  • JSON MIME Type
  • Parsing text to JSON format
  • GetJSON Method and Rendering it's Response
  • AJAX based submitting form data in JSON format
  • Implementation of getJSON Methods
  • Call Back Functions

4
JSON MIME Type
  • application/json, text/JavaScript, text/json,
    text/x-json are the four different mime types
    available for JSON data.
  • Application/ json JSON text MIME media type.
  • Application/ json mime type is adopted by most of
    modern implementations.
  • All most all the applications support mime types.
  • Service providers, browsers, servers, web
    applications, libraries, frameworks, and APIs use
    mime types.
  • Google search API, Flickr, Facebook API and Yahoo
    are example that use MIMEs.

5
Parsing text to JSON format
  • JSON stands for JavaScript Object Notation.
  • JSON.parse() method converts JSON string into an
    object.
  • Syntax JSON.parse(text , reviver)
  • Text is a valid JSON string which is mandatory.
  • Reviver is an optional function uses to transform
    the results.
  • Functions in JSON should be written in the form
    of strings.

6
GetJSON Method and Rendering it's Response
  • GetJSON loads JSON encoded data from the server
    using a GET HTTP request.
  • Syntax jQuery.getJSON( url , data , success
    )
  • URL is a string that contains the URL to which
    the request is sent.
  • Data is a string or plain object which is sent to
    the server with the request.
  • Success is a callback function which get executed
    if the request succeeds.

7
AJAX based submitting form data in JSON format
  • Ajax is useful to exchange the data with servers
    and also update minor changes of a web pages. It
    updates content without reloading the web pages.
  • Ensure the JQuery library is available in the
    page to build then Insert the default web form to
    the page.
  • Now edit form's action form and insert the custom
    bits and final step of the setup is to rig the
    form to the custom script. Syntax
    theForm.submit()
  • Attach theForm.submit() with jqsub().

8
Implementation of getJSON Methods
  • Simple implementation of getJSON is as follows
  • function getJSON( url, cb)
  • var xhr new XMLHttpRequest()
  • xhr.open("GET", url, true)
  • xhr.onreadystatechange function()
  • if (xhr.status ! 100 xhr.readyState ! 4)
    return
  • cb( JSON.parse( xhr.responseText ))
    xhr.send()

9
Call Back Functions
  • Call back functions useful to manage callback
    lists.
  • These functions adds, remove, fire, and disables
    callbacks.
  • callbacks.add(), callbacks.disable(),
    callbacks.disabled(), callbacks.empty(),
    callbacks .fire(), callbacks.fired(),
    callbacks.fireWith(), callbacks.has(),
    callbacks.lock(), callbacks. locked(),
    callbacks.remove(), jQuery.Callbacks() are
    various call back functions of JSON.
  • callbacks.add() function adds a callback or a
    collection of callbacks to a callback list.
  • callbacks.disable() function disables a callback
    list from doing anything more.

10
Call Back Functions
  • callbacks.fire() function calls all of the
    callbacks with the given arguments.
  • callbacks.remove() function remove a callback or
    a collection of callbacks from a callback list.
  • callbacks.lock() function locks callback list in
    its current state.
  • jQuery.Callbacks() function manages callback
    lists.
  • callbacks.locked() function determines if the
    callbacks list has been locked.
  • callbacks.fired() function determines if the
    callbacks been called at least once.

11
Feedback
Like It ? Hate It?
We would love to hear from you whatever you think
about the course.
Click HERE to share what you think!
12
Thank you
Thank You for Watching JQuery JSON Tutorial
Videos for Beginner by
http//www.courseing.com
Write a Comment
User Comments (0)
About PowerShow.com