应用所有代码后,我的页面上没有显示任何内容

时间:2014-07-12 09:10:40

标签: javascript fine-uploader

我刚购买了WindowsAzure的Fine Uploader许可证。

我尝试应用以下所有建议的代码: http://docs.fineuploader.com/quickstart/02-setting_options-azure.html

或来自下载的Fine Uploader包中的default.html文件。

在我将其发布到Windows Azure网站并运行后,我的页面上没有显示任何内容。

我使用MVC 5和Microsoft Visual Studio 2013进行开发。

我的代码最可能出现的错误是什么?

非常感谢。

此致 JRW。

我的代码副本:

在头部:

  <link rel="stylesheet" type="text/css" href="http://www.tipao.net/css/custom.fineuploader-5.0.3.min.css" />

在身体部分:

<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="http://www.tipao.net/Scripts/custom.fineuploader-5.0.3.min.js" type="text/javascript"></script>

<div id="upload_window" class="white_content" style="height:auto; top:20%; left:30%; width:40%;">
<script type="text/template" id="qq-template">
    <div class="qq-uploader-selector qq-uploader">
        <div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
            <div class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
        </div>
        <div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
            <span>Drop files here to upload</span>
        </div>
        <div class="qq-upload-button-selector qq-upload-button">
            <div>Upload a file</div>
        </div>
        <span class="qq-drop-processing-selector qq-drop-processing">
            <span>Processing dropped files...</span>
            <span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
        </span>
        <ul class="qq-upload-list-selector qq-upload-list">
            <li>
                <div class="qq-progress-bar-container-selector">
                    <div class="qq-progress-bar-selector qq-progress-bar"></div>
                </div>
                <span class="qq-upload-spinner-selector qq-upload-spinner"></span>
                <span class="qq-edit-filename-icon-selector qq-edit-filename-icon"></span>
                <span class="qq-upload-file-selector qq-upload-file"></span>
                <input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
                <span class="qq-upload-size-selector qq-upload-size"></span>
                <a class="qq-upload-cancel-selector qq-upload-cancel" href="#">Cancel</a>
                <a class="qq-upload-retry-selector qq-upload-retry" href="#">Retry</a>
                <a class="qq-upload-delete-selector qq-upload-delete" href="#">Delete</a>
                <span class="qq-upload-status-text-selector qq-upload-status-text"></span>
            </li>
        </ul>
    </div>
</script>

<button id="close_upload_window" style="width:100px; height:30px;" onclick="close_upload_window()">Close</button>

这是我初始化Fine Uploader之后的代码:

<div id="upload_window" class="white_content" style="height:auto; top:20%; left:30%; width:40%;">

<link rel="stylesheet" type="text/css" href="http://www.tipao.net/css/custom.fineuploader-5.0.3.min.css" />

<div id="fine-uploader">
</div>

<!-- jQuery version 1.10.x (if you are using the jQuery plugin -->
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>

<!-- Fine Uploader-jQuery -->
<script src="http://www.tipao.net/scripts/custom.fineuploader-5.0.3.min.js" type="text/javascript"></script>

<script>
// Wait until the DOM is 'ready'
$(document).ready(function () {
    $("#fine-uploader").fineUploaderAzure({
        request: {
            endpoint: 'https://XXXXXX.blob.core.windows.net/XXXX'
        },
        signature: {
            endpoint: '/signature'
        },
        uploadSuccess: {
            endpoint: '/success'
        },
        retry: {
            enableAuto: true
        },
        deleteFile: {
            enabled: true
        }
    });
});
</script>

<script type="text/template" id="qq-template">
    <div class="qq-uploader-selector qq-uploader">
        <div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
            <span>Drop files here to upload</span>
        </div>
        <div class="qq-upload-button-selector qq-upload-button">
            <div>Upload a file</div>
        </div>
        <span class="qq-drop-processing-selector qq-drop-processing">
            <span>Processing dropped files...</span>
            <span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
        </span>
        <ul class="qq-upload-list-selector qq-upload-list">
            <li>
                <div class="qq-progress-bar-container-selector">
                    <div class="qq-progress-bar-selector qq-progress-bar"></div>
                </div>
                <span class="qq-upload-spinner-selector qq-upload-spinner"></span>
                <span class="qq-edit-filename-icon-selector qq-edit-filename-icon"></span>
                <span class="qq-upload-file-selector qq-upload-file"></span>
                <input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
                <span class="qq-upload-size-selector qq-upload-size"></span>
                <a class="qq-upload-cancel-selector qq-upload-cancel" href="#">Cancel</a>
                <a class="qq-upload-retry-selector qq-upload-retry" href="#">Retry</a>
                <a class="qq-upload-delete-selector qq-upload-delete" href="#">Delete</a>
                <span class="qq-upload-status-text-selector qq-upload-status-text"></span>
            </li>
        </ul>
    </div>
</script>

<button id="close_upload_window" style="width:100px; height:30px;" onclick="close_upload_window()">Close</button>

1 个答案:

答案 0 :(得分:0)

简单:您没有初始化Fine Uploader实例。至少,您需要构建一个Fine Uploader实例并传递一些基本配置选项。您在问题中引用的确切链接中包含此内容。

引用您在问题中引用的文档链接,在这种情况下,您可以通过以下方式初始化Fine Uploader:

if (qq.supportedFeatures.ajaxUploading) {
    $("#fine-uploader").fineUploaderAzure({
        request: {
            endpoint: 'https://{ YOUR_STORAGE_ACCOUNT_NAME }.blob.core.windows.net/{ YOUR_CONTAINER_NAME }'
        },
        signature: {
            endpoint: '/signature'
        },
        uploadSuccess: {
            endpoint: '/success'
        }
    });
}

您还需要在标记中添加一个fine-uploader ID元素。