JavaScript Ajax class ajaxrequest2007-12-31 update _ajax related

Source: Internet
Author: User
Ajaxrequest is a lightweight AJAX application development framework that is compatible with Firefox, IE, Opera, and Safari, making it easy to do some of the operations that are often needed in Ajax, simplifying development steps and reducing the amount of repetitive code written.

If you find a problem in the course of use, or have good comments and suggestions, you can send me an email, vipxjw[at]163[dot]com.

Ajaxrequest v0.7.12 released in 2007-12-31

1. Add Stopupdate method

2. Modify Update method return value to update request ID for ajaxrequest stop update

3. Modify the form validation properties of the Postf method onsubmit to OnValidate

4. Modify the parameters of the Postf method to post (form, [callback]), remove the action and methods parameters

5. Fixed post method parameter content default value is not a global content property problem

6. Fixed the problem that the Postf method transmits "+" when the space is received

7. Correcting the problem of Onrequeststart and onrequestend name errors in Ajaxrequest class construction parameters

8. Fix the problem of sending a request using synchronous method

For more detailed instructions, see the Ajaxrequest Developer's Manual: http://ajax.xujiwei.cn/
For more use examples see Ajaxrequest development example: http://www.xujiwei.cn/demo/ajaxrequest/
Update description

1. Modify the return value of the Update method to update request ID

In this release, the Update method no longer returns a timer ID, that is, you cannot use the Clearinterval method to stop the update using the return value of the Update method, but instead use the Stopupdate method inside the Ajaxrequest to stop the update.

In addition, not only does an unlimited update return the update ID, the limit update also returns an update ID, that is, if only the specified number of times is updated, the Stopupdate method can also be used to stop the update until the specified number of updates has been reached.

Example (JavaScript):

Program code: [Copy Code to clipboard]
Copy Code code as follows:

Code sample by Xujiwei
site:http://www.xujiwei.cn/
var ajax = new Ajaxrequest ();
var u;
Start an unlimited number of times to update objects from test.asp at intervals of 1 seconds updateobj
function Start () {
U = ajax.update ("Updateobj", "test.asp", 1000);
}
Stop update
function Stop () {
Ajax.stopupdate (U);
}


2. Modify the form validation properties of the Postf method onsubmit to OnValidate

If onsubmit is used for form validation, it may conflict with some applications, and therefore change the form validation property to OnValidate, for example (HTML):
Copy Code code as follows:

Code sample by Xujiwei
site:http://www.xujiwei.cn/
<form action= "test.asp" method= "POST" onvalidate= "return Checkform ();" >
</form>


3. The parameters for modifying the Postf method are post (form, [callback])

This modification limits the parameters of the Postf method to form objects and callback functions, that is, the action and methods must be specified in the form label, example (HTML):

Program code:
Copy Code code as follows:

Code sample by Xujiwei
site:http://www.xujiwei.cn/
The action and method properties of the form label must specify
<form action= "test.asp" method= "POST" >
</form>

Local Downloads
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.