一 代码
fun.js
function progress(){ setInterval("beginProgress()", 200); } function beginProgress(){ $.get("progress.php", null, function(data){ $("#pg").css("width", data+"%"); $("#pgtext").html("The progress is "+data+"%"); }); }
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>jQuery制作进度条</title> </head> <script language="javascript" src="js/jquery-1.3.2.js"></script> <script language="javascript" src="js/fun.js"></script> <body> <div style="width:200px; height:12px; border:1px solid #0000FF"> <div id="pg" style="width:0%; height:100%;background-color:#0000FF"></div> </div> <br> <div id="pgtext" style="width:100px; height:20px"></div> <br> <input type="button" value="开始" onclick="progress()" /> </body> </html>
progress.php
<?php $file = "./count.txt"; $fp = fopen($file, "r"); $txt = fread($fp, filesize($file)); echo $txt; $fp1 = fopen($file, "w"); if($txt<100){ $txt++; fwrite($fp1, $txt); }else{ fwrite($fp1, 1); } fclose($fp1); fclose($fp); ?>
二 运行结果
相关推荐
ajax进度条ajax进度条ajax进度条ajax进度条
jsp中使用ajax实现web进度条
ssh2(struts2+spring2.5+hibernate3.3+ajax)带进度条文件上传(封装成标签)
vs2013 利用Ajax+Jquery实现异步进度条效果
当用户由页面请求服务器太久时,如果任由页面显示为空白,显得不够人性化, 而且在执行改请求的过程中,应该给予提示,防止用户执行其他操作
Ajax实现文件上传进度条,Ajax实现文件上传进度条Ajax实现文件上传进度条Ajax实现文件上传进度条Ajax实现文件上传进度条。
ajax上传文件,ajax实现进度条,及springMvc上传文件实现进度条
AJAX实现上传进度条教程
jsp,ajax进度条jsp,ajax进度条jsp,ajax进度条jsp,ajax进度条
带进度条的附件上传,可以根据自己的要求修改里面的方法。
ajax进度条.doc ajax进度条.doc
asp+ajax上传带进度条
初次整理有点乱,见谅, uploadify 的具体使用见我的博客: http://blog.csdn.net/tianlele_xl/article/details/6151964
可用于站点中,使网站更加具备交互性,使用简单,直接插入原代码的相应位置即可
博文链接:https://daihoufa.iteye.com/blog/184212
随着ajax技术的流行以及用户体验得到越来越高的重视,各种注视用户体验的程序出现,比如带进度条的文件上传,看了网上很多资料还没找到真正意义上的ASP.NET实现进度条上传.Ajax 文件上传进度条,ASP.NET 文件上传...
网页加载时的ajax动态进度条。 目前比较流行的技术。而且是chm格式的哦
ajax上传+进度条+用户自定义 栗子出品,必属精品
ajax无刷新进度条上传文件,大家来评论下吧