Bootstrap progress bar and AJAX backend data transmission combined with instance details, bootstrapajax
Many times, when we execute a URL request on the page, there is a waiting time. For direct page Jump, the browser will display the buffer progress, but for AJAX, I think I should add the progress bar myself. After all the data is received, the progress bar disappears and the page will be displayed.
After AJAX is used in the Yii framework, it makes data interaction between the front and back end much easier.
Paste the code below.
Controller
public function actionTest(){ if(isset($_POST["number"])){ $html = “success”; }else{ $html ="something wrong"; } sleep(5); echo $html; Yii::app()->end();}
View
<! -- Modal) --> <div class = "modal fade" id = "searchModal" tabindex = "-1" role = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "true"> <div class = "modal-dialog"> <div class = "modal-content"> <div class = "modal-body"> <div id = 'modal _ message' style = "text-align: center ">
The above section describes how to use the Bootstrap progress bar and AJAX backend data transmission. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!