Uploadify verursacht Fehler in IE 7/8
-
06-07-2019 - |
Frage
Aus irgendeinem Grund, wenn ich eine Seite mit Uploadify lade, erhalte ich in IE 8 diese Webseitenfehlerdetails
Benutzeragenten: Mozilla/4.0 (kompatibel; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; Sonne, 29. November 2009 01:36:52 UTC
Nachricht: Objekt unterstützt diese Eigenschaft oder Methodenzeile nicht
Dies funktioniert gut in FF und Safari Chrome
Meine 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'
});
Dies ist die Zeile aus der UN MIN -Version:
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);
Lösung
Ich habe dieses Problem konfrontiert. Dies geschieht, weil Uploadify in dieser Zeile "Einstellungen" verwendet und, wenn Sie eine ID mit dem Namen "Einstellungen" in Ihrem HTML haben, eine Ausnahme in IE ausgeladen hat. Scheint, als ob FF und Safari dieses Problem ignorieren. Halten Sie also einfach keine IDs mit dem Namen "Einstellungen" in der HTML Ihrer Seite, die die Uploadify -Komponente enthält, und Sie sollten gut sein :)
Andere Tipps
Etwas, das ich gerade entdeckt habe, ist, dass in IE, wenn der Upload -Bereich bei der Initialisierung der SWF -Datei verborgen ist, das Uploadify -Onopen () -Ereignis niemals ausbreitet und das Upload der Datei niemals beginnt. Stellen Sie also sicher, dass die DIV, in der Ihre Tracks hochgeladen sind, nicht mit CSS versteckt werden, um später in dem Moment zu angezeigt zu werden, in dem die Uploadify -Funktion beginnt oder die Funktion nicht abfängt, bis die Div -Asset -Bereichs -DIV angezeigt wird.
Können Sie versuchen, die nicht-minimierte Version von JQuery zu verwenden und die fragliche Zeile zu veröffentlichen? Auf diese Weise kann jemand aus der Fehlermeldung sinnvoll sein.
Nun, das Problem ist, dass Ihr IE keine Flash-Version installiert hat.
Damit das Uploadify-Skript die Variable nicht steigt swfuploadify
Weil die Variable flashInstalled
ist false
.
Installieren Sie eine Flash-Version für Ihren Browser oder verwenden Sie die HTML5-Version
Und wenn Sie einen weiteren Fehler im IE -Like haben Object expected
Dann sollte die folgende Seite es lösen: Verknüpfung