English 中文(简体)
1. 定制AJAX文档上载AJAX中载重机
原标题:Customizing AJAX File Uploader with AJAX Upload

I am trying to use http://valums.com/ajax-upload/ to upload files via AJAX. The reason why is because it meets my needs. However, I need to customize the behavior and I can t figure it out. According to the documentation, I should be able to use FileUploaderBasic, but I can t even get an upload button to appear with FileUploaderBasic. Currently, I m trying the following:

<div id="file-uploader">                
    <noscript>                      
        <p>Please enable JavaScript to use file uploader.</p>           
    </noscript>             
</div>
<div id="progressbar" style="width:300px;"></div>

<script type="text/javascript">
    $().ready(function () {
        var u = new uploader.FileUploaderBasic({
            element: document.getElementById( file-uploader ),
            action:  /files/upload ,
            debug: true,
            onProgress: function (id, fileName, loaded, total) {
                $("#progressbar").progressbar("value", 50);
            },
            onComplete: function(id, fileName, responseJSON){
                $("#progressbar").progressbar("value", 100);            
            },
        });

        $("#progressbar").progressbar({
            value: 0
        });
    });
</script>

对于正在上载的每份档案,我要显示进展棒的右边,我要显示已完成的上载体的百分比。 在进展栏下,我要显示档案名称和档案总尺寸。 我知道超文本是这样:

<table border= 0  cellpadding= 0  cellspacing= 0 >
  <tr><td rowspan= 2 >[img]</td>
    <td>[Progress Bar]</td>
    <td>[%]</td>
  </tr>

  <tr><td colspan= 2 >[filename] - [filesize]</td></tr>
</table>

我不敢肯定如何用文件上载荷Basic来做到这一点。 我做了什么错误? 我到了绝望的地步。 请帮助!

问题回答

审判

element: document.getElementById ( fileuploader >

纽约总部

button: document.getElementById ( fileuploader >





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签