我使用 Valums qq.FileUploader(ex-AjaxUpload) 插件在我的 Asp.net mvc 3 应用程序中上传...
我的页面中有一些按钮add-newimage
,通过单击它我得到模态窗口,我通过加载部分视图将数据加载到该窗口中。
在那个部分视图中,我有按钮upload-image
,我想在其中初始化我的 qq.FileUploader,但它在任何地方都不起作用......
这是代码
$("#add-newimage").click(function () {
$("#add-image").load('/Design/AddImage/', function () {
$("#add-image").dialog('open');
var uploader= new qq.FileUploader({
element: document.getElementById("upload-image"),
action: '/Design/UploadImage',
allowedExtensions: ['jpg'],
onComplete: function (id, fileName, responseJSON) {
$("#hidden-path input").html("/Img/Temp/@User.Identity.Name/" + file);
alert($("#hidden-path input").html());
}
});
});
});
我怎样才能让它工作?