Jquery UI 进度条未初始化?
我正在尝试在我的网络应用程序中使用 jQuery UI 进度条。 但这没有被显示。我正在使用 DWR 调用来获取上传状态。在使用 Jquery UI 进度条之前,我只是按原样显示从服务器返回的状态,以确保数据来自服务器。一切正常。
代码
<body>
<script type="text/javascript">
$(document).ready(function(){
var progressbar = $("#jqProgressBar");
progressbar.css({
"width" : "200px",
"height" : "10px"
});
$("#jqProgressBar").progressbar({'value':0});
});
function statusUpdate() {
FileUploadProgressListener.getFileUploadStatus(function(status){
if(status >= 95)
{
status = 100;
$("#jqProgressBar").progressbar({'value':status});
return;
}
else
{
$("#jqProgressBar").progressbar({'value':status});
window.setTimeout(statusUpdate, 200);
}
});
return true;
}
</script>
<h4>File Upload</h4>
<iframe id="uploadFrameID"
name="uploadFrame"
height="0" width="0"
frameborder="0"
scrolling="yes"></iframe>
<form action="ProfileImageUpload"
enctype="multipart/form-data" method="post"
onsubmit="setTimeout('statusUpdate()', 1000)" target="uploadFrame">
<input type="file" name="fileupload_upload" value="Upload File">
<input type="submit" value="Upload">
</form>
<div id="jqProgressBar"></div>
</body>
任何建议!
I am trying to use jQuery UI progress bar in my web app.
But that is not getting displayed. I am using a DWR call to get the upload status. Before using Jquery UI progressbar, i just displayed the status returned from server as just as it is, to make sure the data coming from server. It was working fine.
The Code
<body>
<script type="text/javascript">
$(document).ready(function(){
var progressbar = $("#jqProgressBar");
progressbar.css({
"width" : "200px",
"height" : "10px"
});
$("#jqProgressBar").progressbar({'value':0});
});
function statusUpdate() {
FileUploadProgressListener.getFileUploadStatus(function(status){
if(status >= 95)
{
status = 100;
$("#jqProgressBar").progressbar({'value':status});
return;
}
else
{
$("#jqProgressBar").progressbar({'value':status});
window.setTimeout(statusUpdate, 200);
}
});
return true;
}
</script>
<h4>File Upload</h4>
<iframe id="uploadFrameID"
name="uploadFrame"
height="0" width="0"
frameborder="0"
scrolling="yes"></iframe>
<form action="ProfileImageUpload"
enctype="multipart/form-data" method="post"
onsubmit="setTimeout('statusUpdate()', 1000)" target="uploadFrame">
<input type="file" name="fileupload_upload" value="Upload File">
<input type="submit" value="Upload">
</form>
<div id="jqProgressBar"></div>
</body>
Any suggestions!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在更改值的代码中使用这一行:
try using this line in the code that changes the value: