Ajax Jquery Ajax
Ajax Jquery Ajax
AJAXOPTIONS METHOD
http://www.tutorialspoint.com/jquery/ajax-jquery-ajax.htm Copyright © tutorialspoint.com
Description
The jQuery.ajaxoptions method loads a remote page using an HTTP request.
$.ajax() returns the XMLHttpRequest that it creates. In most cases you won't need that object to
manipulate directly, but it is available if you need to abort the request manually.
Syntax
Here is the simple syntax to use this method −
$.ajax( options )
Parameters
Here is the description of all the parameters used by this method −
options − A set of key/value pairs that configure the Ajax request. All options are optional.
Here is the list of option which could be used as key/value pairs. Except URL, rest of the
parameters are optional −
1 async
A Boolean indicating whether to perform the request asynchronously. The default value
is true.
2 beforeSend
3 complete
4 contentType
A string containing a MIME content type to set for the request. The default value is
application/x-www-form-urlencoded.
5 data
6 dataFilter
7 dataType
A string defining the type of data expected back from the server xml, html, json, orscript.
8 error
9 global
A Boolean indicating whether global AJAX event handlers will be triggered by this
request. The default value is true.
10 ifModified
A Boolean indicating whether the server should check if the page is modified before
responding to the request.
11 jsonp
12 password
13 processData
A Boolean indicating whether to convert the submitted data from an object form into a
query-string form. The default value is true.
14 success
15 timeout
Number of milliseconds after which the request will time out in failure.
16 timeout
17 type
A string defining the HTTP method to use for the request GETorPOST. The default value is
GET.
18 url
19 username
20 xhr
Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when
available IE, the XMLHttpRequest otherwise.
Example
Assuming we have following HTML content in result.html file −
<h1>THIS IS RESULT...</h1>
Following is a simple example a simple showing the usage of this method. Here we make use of
success handler to populate returned HTML −
<html>
<head>
<title>The jQuery Example</title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<div >
STAGE
</div>
</body>
</html>
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js