EXT Ajax submit request

Source: Internet
Author: User
Step 1: introduce the corresponding JS

<Link href = "../extjs/resources/CSS/ext-all.css" rel = "stylesheet" type = "text/CSS"/>
<SCRIPT src = "../extjs/adapter/EXT/ext-base.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "../extjs/ext-all.js" type = "text/JavaScript"> </SCRIPT>

Step 2: Write the following code:
<Script language = "JavaScript" type = "text/JavaScript">
Ext. onready (function (){

Ext. Get ('btnsave'). On ('click', function (){
Ext. msg. Wait ('processing, please wait... ', 'hprompt'); // progress bar waiting
Ext. Ajax. Request ({
Method: 'post', // get and post Methods
URL: 'ajax. ashx', // submission address
Success: function (result ){
Ext. msg. Hide ();
// Return result. responsetext
Ext. msg. Alert (result. responsetext );
},
Failure: function (result ){
// Return result. responsetext
}
});
});

});
</SCRIPT>

Step 3: Add HTML control tags
<! -- HTML button tag -->

<Input type = "button" value = "click on me" id = "btnsave"/>

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.