Ext. Ajax. Request

Source: Internet
Author: User

 

Code

/**
* @ Author L
*/
Function grant (){
Ext. Ajax. Request ({
// The X-mask-loading effect is displayed when Ajax is submitted.
Ext. getbody (). Mask ("permission allocation... please wait...", "x-mask-loading ");
URL: '/.../e_r_t', // submitted URL
// Failed operation (the failure here refers to a running error, such as 404,500 error)
Failure: function (){
// Remove the X-mask-loading effect
Ext. getbody (). Unmask ();
Ext. msg. Alert ('user authorization', 'user authorization failed! ');
},

// Successful operation
Success: function (response, option) {// The option parameter is useless.
// Remove the X-mask-loading effect
Ext. getbody (). Unmask ();
// Ext. msg. Alert ('user authorization', 'user authorization successful! ');
VaR responsearray = ext. util. JSON. Decode (response. responsetext); // get the returned josn
Alert (responsearray.info); // The displayed content is displayed.
},
Params :{
Qxlist: checked // Parameter
}
})
}
/**
* @ Author L
*/
Function grant (){
Ext. Ajax. Request ({
// The X-mask-loading effect is displayed when Ajax is submitted.
Ext. getbody (). Mask ("permission allocation... please wait...", "x-mask-loading ");
URL: '/.../e_r_t', // submitted URL
// Failed operation (the failure here refers to a running error, such as 404,500 error)
Failure: function (){
// Remove the X-mask-loading effect
Ext. getbody (). Unmask ();
Ext. msg. Alert ('user authorization', 'user authorization failed! ');
},

// Successful operation
Success: function (response, option) {// The option parameter is useless.
// Remove the X-mask-loading effect
Ext. getbody (). Unmask ();
// Ext. msg. Alert ('user authorization', 'user authorization successful! ');
VaR responsearray = ext. util. JSON. Decode (response. responsetext); // get the returned josn
Alert (responsearray.info); // The displayed content is displayed.
},
Params :{
Qxlist: checked // Parameter
}
})
}

The method is as follows:

Ruby code
Def create_right_task
# It is said that the josn
TEXT = % {success: false, Info: 'failed to add '}}
Render: text => text,: Layout => false
End

 

 

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.