jquery ajax
Download
Skip this Video
Download Presentation
jQuery AJAX

Loading in 2 Seconds...

play fullscreen
1 / 7

jQuery AJAX - PowerPoint PPT Presentation


  • 163 Views
  • Uploaded on

jQuery AJAX. AJAX. AJAX = Asynchronous JavaScript and XML Loading data in the background Display on the Web page w/o reloading jQuery simplifies writing AJAX code. jQuery load(). Simple and powerful AJAX method Puts the returned data into the selected element

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' jQuery AJAX' - willem


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2
AJAX
  • AJAX = Asynchronous JavaScript and XML
    • Loading data in the background
    • Display on the Web page w/o reloading
  • jQuery simplifies writing AJAX code
jquery load
jQuery load()
  • Simple and powerful AJAX method
  • Puts the returned data into the selected element
    • $(selector).load(URL,data,callback);
      • URL, required, the URL to load
        • Can add selector to end of URL
      • data, optional, key-value pairs to send
      • callback, optional, function to run when complete
        • function(responseTxt,statusTxt,xhr) {…}
jquery load1
jQuery load()
  • Callback function
    • function(response,status,xhr)
      • response contains the result data from request
      • status contains the status of the request
        • “success”, “notmodified”, “error”, “timeout”, “parsererror”
      • xhr contains the XMLHttpRequest object
jquery get
jQuery get()
  • Creates an HTTP GET request
    • $.get(URL,data,callback,dataType)
      • URL, required
      • data, optional, key-value pairs sent to server
      • callback, optional
        • function(data,status,xhr)
      • dataType, optional, the data type expected of the server response
        • “xml”, “html”, “text”, “script”, “json”
jquery post
jQuery post()
  • Creates an HTTP POST request
    • $.post(URL,data,callback,dataType)
      • URL, required
      • data, optional, data to send to server
      • callback, optional
        • function(data,status,xhr)
      • dataType, optional, the data type of the expected server response
jquery ajax1
jQueryajax()
  • Generic AJAX HTTP request
    • $.ajax({name:value,name:value,…})
      • url: specifies the URL
      • type: specifies the type of HTTP request
      • content: specifies “this” for callback functions
      • success:function(result,status,xhr) runs if request is successful
      • error:function(result,status,xhr) runs if there is an error
      • complete:function(xhr,status) runs after request is finished (success and error)
ad