Bootstrap progress bar and AJAX backend data transmission combined with instance details, bootstrapajax

Source: Internet
Author: User

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!

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.