IE 7/8에서 발생하는 오류를 업로드합니다
-
06-07-2019 - |
문제
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; 미디어 센터 PC 6.0) Timestamp : Sun, 2009 년 11 월 29 일 01:36:52 UTC
메시지 : 객체는이 속성 또는 메소드 라인을 지원하지 않습니다 : 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'
});
이것은 UN 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);
해결책
나는이 문제에 직면했다. Uploadify는 해당 라인에서 '설정'을 사용하고 HTML에 '설정'이라는 ID가있는 경우 업로드는 예외를 발생시키기 때문에 발생합니다. FF와 Safari는이 문제를 무시하는 것처럼 보입니다. 따라서 업로드 구성 요소가 포함 된 페이지의 HTML에 '설정'이라는 ID를 유지하지 마십시오. :)
다른 팁
방금 발견 한 것은 SWF 파일이 초기화 될 때 업로드 영역이 숨겨져 있으면 업로드 onopen () 이벤트가 발생하지 않으며 파일 업로드가 시작되지 않는다는 것입니다. 따라서 트랙이 업로드 된 DIV가 CSS와 함께 숨겨져 있지 않은지 확인하십시오. 업로드 기능이 시작되거나 자산 영역 DIV가 표시 될 때까지 기능이 시작되거나 발사되지 않습니다.
Miniminized 버전의 jQuery를 사용하여 해당 라인을 게시 할 수 있습니까? 그렇게하면 누군가가 오류 메시지에서 이해할 수 있습니다.
문제는 IE에 플래시 버전이 설치되어 있지 않다는 것입니다.
업로드 스크립트가 변수를 비교하지 않도록합니다 swfuploadify
변수이기 때문에 flashInstalled
~이다 false
.
브라우저의 플래시 버전을 설치하거나 html5-version을 사용하십시오.
그리고 IE가 좋아하는 또 다른 오류가 있다면 Object expected
그런 다음 다음 페이지가 해결해야합니다. 링크