Uploadify OnComplete使用asp.net显示图像和图像URL
我试图将图像上传到文件夹然后尝试在上传时立即显示它我能够显示图像并且无法同时显示它的URL。
但我个人可以互相展示。
任何帮助将不胜感激
提前致谢
这是我的java脚本代码:
$(window).load( function () { $("#Inputfile").fileUpload({ 'uploader': 'scripts/uploader.swf', 'cancelImg': 'images/cancel.png', 'buttonText': 'Browse Files', 'script': 'UploadVB.ashx', 'folder': 'uploads', 'fileDesc': 'Image Files', 'fileExt': '*.jpg;*.jpeg;*.gif;*.png', 'queueSizeLimit': 3, 'simUploadLimit': 2, 'sizeLimit' : 4000000, 'multi': true, 'auto': false, 'onQueueFull' : function (event,queueSizeLimit) { alert("I'm stuffed, please don't put anymore files in me!"); return false; }, 'onComplete': function (event, queueID, fileObj, response, data) { $("#showimage").append(""); $("#showimage").html(document.write('http://localhost:XXXX' + fileObj.filePath)); }, 'onError' : function (event,ID,fileObj,errorObj) { alert(errorObj.type + ' Error: ' + errorObj.info); } }); } );
.html()正在用html替换$("#showimage")
的内容,这就是擦除图像。 尝试在html中包含您的图片代码:
$("#showimage").html('
http://localhost:XXXX' + fileObj.filePath);
- 当第一个下拉列表中的项目发生更改时,下拉列表不会填充在“modal dialog”中
- Javascript只允许数字粘贴
- jQuery AJAX与UpdatePanel
- Valum文件上传 – 适用于Chrome但不适用于IE,Image img = Image.FromStream(Request.InputStream)
- jQuery DatePicker:当日期字段为12-31-9999时,currentDate不起作用
- 在Microsoft Ajax中,$ find究竟做了什么?
- 使用JQuery重新加载部分视图
- 如何从.cs文件(C#)调用JavaScript / jQuery函数
- JavaScript运行时错误:无法获取未定义或空引用的属性“msie”