such as the default submit button to do this:; And so on, we can do this first.
;
The meaning is actually very simple, first put the AJAXPOST hint information in the div content empty. Then submit. Finally, judging by the return value.
Copy Code code as follows:
function Checkpostresult () {
var cid = setinterval (function () {
if ($ (' __formid '). innertext = = ' success ') {
Alert (' submit successfully ');
location.href= ' xxxxx.php ';
Clearinterval (CID);
}
},1000);
}
This process is also very simple, why use setinterval and clearinterval, mainly because Ajax is asynchronous operation, if not setinterval method, then at the end of Ajaxpost, In fact, the hint information has not been append to the ID of the hint information, so use the SetInterval method to delay and then loop the end of the prompt ...
Clearinterval use is not very right, but in a short time unexpected better. Let's settle this temporarily.
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