dqst96444 2013-09-11 08:08
浏览 52
已采纳

如何在等待服务器进程的同时使用jQuery和PHP创建进度条?

It used to be easy to find solutions of my problem when Google gives many accurate results that point to Stackoverflow. But, I didn't found one for this problem. If any of you have suggestion where should I go for this problem, please give me link to the answer.

The case is I want to make searching index from database. The indexing process is triggered by jQuery.getJSON. It takes minutes to finish so I want to make progress bar to show that indexing process. I know how to make common ajax request using .getJSON as client side and PHP as server side, but It seems difficult for me to imagine how to make such progress bar.

Is there any body that can explain to me how to do that?

  • 写回答

2条回答 默认 最新

  • dpd2349 2013-09-11 08:12
    关注
    1. check Jquery Progress bar UI : http://jqueryui.com/progressbar/
    2. use .getJSON or an ajax call every 10 seconds to call the server and check the progress
    3. after you get the server progress update the UI

    Explaining Step2

    step 2 is generally based on your application flow, lets say for example i'm inserting 100,000 records in MYSQL, i would create another service that will check the rows count and the result were 30,000 records for example, that means the progress now is 30%, so if i call this service every 10 seconds i would get the current progress.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 数学的三元一次方程求解
  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题