Uchome Discuz Uchome ajaxpost tips

WBOY
Release: 2016-07-29 08:44:05
Original
1188 people have browsed it

For example, the default submit button operates like this: >Copy code The code is as follows:


function checkPostResult(){
var cid = setInterval(function(){
if( $('__formid').innerText == 'success '){
alert('Submission successful');
location.href='xxxxx.php';
clearInterval(cid);
}
},1000);
}


This process is also very simple, why? Use setInterval and clearInterval mainly because ajax is an asynchronous operation. If the setInterval method is not used, then when the ajaxpost ends, the prompt information has not actually been appended to the ID where the prompt information is located, so the setInterval method is used to delay first and then loop through it. End prompt. . .
clearInterval is not used correctly, but I can’t think of a better one in a short time. This is a temporary solution first.

The above introduces uchome Discuz Uchome ajaxpost tips, including uchome content, I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!