Jquery 上传导致IE 7/8中出现错误
由于某种原因,当我用uploadify加载一个页面时,在IE8中我得到了这个 网页错误详细信息 用户代理: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) 时间戳:Sun,2009年11月29日01:36:52 UTC 消息:对象不支持此属性或方法 第26行 字符:86 代码:0 URI:jquery.uploadify.v2.1.0.min.js 这在FF和Safari Chrome中工作良好 我的jqueryJquery 上传导致IE 7/8中出现错误,jquery,internet-explorer,uploadify,Jquery,Internet Explorer,Uploadify,由于某种原因,当我用uploadify加载一个页面时,在IE8中我得到了这个 网页错误详细信息 用户代理: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) 时间戳:Sun,2009年11月29日01:36:52 UTC 消息:对象不支持此属性或方法 第26行 字符:86 代码:0
$("#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);
您可以尝试使用Jquery的非最小化版本并发布有问题的行吗?这样,可能有人能够理解错误消息 您可以尝试使用Jquery的非最小化版本并发布有问题的行吗?这样,可能有人能够理解错误消息 我曾经面对过这个问题。这是因为Uploadify在该行使用“设置”,如果html中有一个名为“设置”的id,Uploadify会在IE中抛出一个异常。看起来FF和Safari忽略了这个问题。因此,不要在包含Uploadify组件的页面的html中保留任何名为“settings”的ID,你应该很好:)我遇到了这个问题。这是因为Uploadify在该行使用“设置”,如果html中有一个名为“设置”的id,Uploadify会在IE中抛出一个异常。看起来FF和Safari忽略了这个问题。因此,不要在包含Uploadify组件的页面的html中保留任何名为“settings”的ID,你应该很好:)我刚刚发现,在IE中,如果在swf文件初始化时上载区域被隐藏,Uploadify onOpen()事件永远不会触发,文件上载也永远不会启动。因此,请确保上传曲目的div没有被css隐藏,以便在uploadify函数启动时稍后显示,或者在显示asset area div之前不要启动该函数。我刚刚发现,在IE中,如果swf文件初始化时上传区域被隐藏,uploadify onOpen()事件从不激发,文件上载也从不启动。因此,请确保上传曲目的div没有被css隐藏,以便在uploadify功能启动时稍后显示,或者在显示资产区域div之前不要启动该功能。问题是,您的IE没有安装Flash版本 因此uploadify脚本不会初始化变量
swfuploadify
,因为变量flashInstalled
是false
为浏览器安装Flash版本或使用HTML5版本
如果你在IE中有另一个错误,比如
预期对象,那么下面的页面应该可以解决它:问题是,你的IE没有安装Flash版本
因此uploadify脚本不会初始化变量swfuploadify
,因为变量flashInstalled
是false
为浏览器安装Flash版本或使用HTML5版本
如果IE中有另一个错误,比如预期对象
,那么下面的页面应该解决它:它是哪一行?整件事?你能指出右边的栏吗?第31行,我从代码第31行开始。这个错误与我在调用它时输入的内容不匹配有关。它是哪一行?整件事?你能指出右边的栏吗?第31行,我从代码第31行开始。这个错误与我在调用它时所做的不匹配有关。非常好的发现,这对我帮助很大。非常好的发现,这对我帮助很大。