2009-11-29 6 views
1

По какой-то причине, когда я загрузить страницу с Uploadify, в IE 8 я получаю эту Webpage сведения об ошибкеUploadify в IE 7/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) Временная метка: вс 29 ноября 2009 г. 01:36:52 UTC

Сообщение: Объект не поддерживает это свойство или метод Line: 26 Char: 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

Я столкнулся с этой проблемой. Это происходит из-за того, что Uploader использует «настройки» в этой строке, и если у вас есть идентификатор с именем «settings» в вашем html, то Uploadify выдает исключение в IE. Похоже, что FF и Safari игнорируют эту проблему. Итак, просто не держите в html вашей страницы идентификаторы «настройки», которые содержат компонент Uploadify, и вы должны быть хорошими :)

+0

Очень приятная находка, это очень помогло мне. – mcassano

0

Вы можете попробовать использовать ип-минимизированы версию JQuery и опубликовать эту строку? Таким образом, кто-то может понять смысл сообщения об ошибке.

+0

Добавлен код выше – matthewb

+0

Какие строки это? Все это? Можете ли вы указать на правый столбец? –

+0

Строка 31, я взял раздел, начиная со строки 31, из кода. Там ошибка имеет какое-то отношение к тому, что не соответствует тому, что я вношу в мой призыв. – matthewb

1

Что-то, что я только что обнаружил, это то, что в IE, если область загрузки скрытый при инициализации SWF-файла, событие uploadify onOpen() никогда не срабатывает, и загрузка файла никогда не запускается. Итак, убедитесь, что div, который загружены ваши дорожки, не скрывается с помощью css, который будет отображаться позже в момент запуска функции uploadify или не будет отключать функцию до тех пор, пока не отобразится div div.

0

Ну, проблема в том, что ваш IE не имеет установленной версии Flash.

Для того чтобы сценарий uploadify не включал переменную swfuploadify, потому что переменная flashInstalled равна false.

Установите Flash-версию для вашего браузера или использовать HTML5-версию

И если у вас есть другая ошибка в IE, как Object expected то следующая страница должна решить: Link

Смежные вопросы