<script language= "Web Effects" src= "Jquery-1.4.2.min.js" ></SCRIPT>
<script language= "JavaScript"
$ (function () {////ajax code area
});
</script>
<body>
<input id= forasp Tutorial "type=" text "Maxlength=" > <input type= "button" value= "Ajax test for jquery" Id= "cn"
<span id= "Backurl" > Www.forasp.cn</span>
</body>
the $.ajax (options) is used to implement Jqueryajax. The submission is set in type, and this Ajax is directly marked with a get way to submit the data.
(1) Syntax: $.get (Url,data,fun,type); The
URL represents the page on which the AJAX call
Date is passed by the Get method, data format {Data:value,data:value.} Optional
Fun is a callback function, function (msg), and MSG is the page return content. Optional
Type returns the content format, XML, HTML, script, JSON, text, and _default. Optional
Instance:
$ ("#cn"). Bind ("click", Function () {
$.get (index4.php tutorial, {foraspcnurl:$ ("#forasp"). Val ()}, Function (msg) {alert (msg);});
}); The call page in the
example is index4.php code as follows: <?echo $_get["Foraspcnurl"];? ".
Jquery.get (URL, [data], [Callback (data, Textstatus, XMLHttpRequest)], [datatype])
Returns:xmlhttprequest
URL string that contains the URL of the request being sent.
The data map or string is sent to the server with the request.
Callback (data, Textstatus, XMLHttpRequest) If the request is successfully executed.
Datatypethe type of data is expected from the server.
This is an abbreviated AJAX feature, which is equivalent to:
$.ajax ({
Url:url,
Data:data,
Success:success,
Datatype:datatype
});
The tuning function successfully returns data passing, which will be an XML root element, a text string, a Web effects file, or a JSON object based on the MIME type of the response. It also passes the response text state.
In jquery 1.4, the successful callback function is also passed through the XMLHttpRequest object.
Most implementations will specify a successful handler:
$.get (' ajax/test.html ', function (data) {
$ ('. Result '). HTML (data);
Alert (' Load was performed. ');
});
For more details please see: http://www.111cn.net/wy/jquery/35462.htm