1

出于某种原因,当我使用 uploadify 加载页面时,在 IE 8 中我收到此网页错误详细信息

用户代理:Mozilla/4.0(兼容;MSIE 8.0;Windows NT 6.1;Trident/4.0;SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729;Media Center PC 6.0)时间戳: 2009 年 11 月 29 日星期日 01:36:52 UTC

消息:对象不支持此属性或方法行:26 字符:86 代码:0 URI:jquery.uploadify.v2.1.0.min.js

这在 FF 和 Safari Chrome 中运行良好

我的jQuery

$("#upload").uploadify({
    uploader: '/assets/scripts/uploadify/uploadify.swf',
    script: '/post/images/uploadify',
    cancelImg: '/assets/scripts/uploadify/cancel.png',
                                buttonImg: '/assets/images/upload_button.png',
    folder: '/public/tmp',
    scriptAccess: 'always',
                                width: 175,
                                height: 46,
                                wmode: 'transparent',
    multi: false,
                                auto:true,
                                sizeLimit: '2000000',
                                buttonText: ' Upload Profile Image',
    'onError' : function (a, b, c, d) {
         if (d.status == 404)
            alert('Could not find upload script.');
         else if (d.type === "HTTP")
            alert('error '+d.type+": "+d.status);
         else if (d.type ==="File Size")
            alert(c.name+' '+d.type+' Limit: Your file size is too big, our max is 100Kb');
         else
            alert('error '+d.type+": "+d.text);
        },
    'onComplete'   : function (event, queueID, fileObj, response, data) {

        $.ajax({type: "POST",url:"/members/image_preview",data:{filearray: response},success: function(info){
            $("#target").html(info);
            },complete: crop});
    }
    //fileExt: '.jpg,.jpeg,.png,.bmp,.gif'
});

这是来自联合国 Min 版本的行:

jQuery(this).each(function(){
                    settings = jQuery.extend({
                    id             : jQuery(this).attr('id'), // The ID of the object being Uploadified
                    uploader       : 'uploadify.swf', // The path to the uploadify swf file
                    script         : 'uploadify.php', // The path to the uploadify backend upload script
                    expressInstall : null, // The path to the express install swf file
                    folder         : '', // The path to the upload folder
                    height         : 30, // The height of the flash button
                    width          : 110, // The width of the flash button
                    cancelImg      : 'cancel.png', // The path to the cancel image for the default file queue item container
                    wmode          : 'opaque', // The wmode of the flash file
                    scriptAccess   : 'sameDomain', // Set to "always" to allow script access across domains
                    fileDataName   : 'Filedata', // The name of the file collection object in the backend upload script
                    method         : 'POST', // The method for sending variables to the backend upload script
                    queueSizeLimit : 999, // The maximum size of the file queue
                    simUploadLimit : 1, // The number of simultaneous uploads allowed
                    queueID        : false, // The optional ID of the queue container
                    displayData    : 'percentage', // Set to "speed" to show the upload speed in the default queue item
                    onInit         : function() {}, // Function to run when uploadify is initialized
                    onSelect       : function() {}, // Function to run when a file is selected
                    onQueueFull    : function() {}, // Function to run when the queue reaches capacity
                    onCheck        : function() {}, // Function to run when script checks for duplicate files on the server
                    onCancel       : function() {}, // Function to run when an item is cleared from the queue
                    onError        : function() {}, // Function to run when an upload item returns an error
                    onProgress     : function() {}, // Function to run each time the upload progress is updated
                    onComplete     : function() {}, // Function to run when an upload is completed
                    onAllComplete  : function() {}  // Function to run when all uploads are completed
                }, options);
4

4 回答 4

4

我遇到过这个问题。发生这种情况是因为 Uploadify 在该行使用了“设置”,并且如果您的 html 中有一个名为“设置”的 ID,则 Uploadify 会在 IE 中引发异常。似乎 FF 和 Safari 忽略了这个问题。因此,不要在包含 Uploadify 组件的页面的 html 中保留任何名为“settings”的 id,您应该会很好:)

于 2010-01-14T11:01:51.957 回答
1

我刚刚发现的是,在 IE 中,如果在初始化 swf 文件时隐藏上传区域,uploadify onOpen() 事件永远不会触发,文件上传永远不会开始。因此,请确保上传曲目的 div 没有被 css 隐藏,以便稍后在 uploadify 功能启动时显示,或者在显示资产区域 div 之前不要触发该功能。

于 2011-06-07T22:29:48.730 回答
0

您可以尝试使用未最小化的 Jquery 版本并发布有问题的行吗?这样,有人可能能够理解错误消息。

于 2009-11-29T01:55:50.947 回答
0

那么问题是,您的 IE 没有安装 Flash 版本。

这样uploadify-script 不会初始化变量swfuploadify,因为变量flashInstalledfalse.

为您的浏览器安装 Flash 版本或使用 HTML5 版本

如果您在 IE 中遇到另一个错误,Object expected那么下面的页面应该可以解决它:链接

于 2013-07-12T08:43:25.063 回答