1 The Done method in Ajax can be used after version 1.5 of jquery. This method has a similar effect as success in Ajax. It must first be after the 1.5 version in jquery.
such as: <link rel= "stylesheet" type= "Text/css" href= "./common/easyui/themes/icon.css" >
<link rel= "stylesheet" type= "Text/css" href= "./common/easyui/themes/default/easyui.css" >
}
}). Done (function (msg) {
Alert ("done by the Doing method");
Eval (func+ "(" +msg+ ")");//execute callback function. MSG is a parameter passed back in the background
});
}
3 then call it in JS. The URL is a path. Func is a callback function.
such as: Submitajax (Urlhelper ("Demoservice", "Getdemosbyquery", obj), "showmessage");
function ShowMessage (msg) {
Alert ("Here is the callback function:" +msg);
}
Here the MSG is passed back in the background parameters. by Resp.getwriter (). Print (flag), the value of the flag passed back. is a string.
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