javascript - 在ie9中上传得到js错误: SCRIPT5007: Object expected

标签 javascript internet-explorer internet-explorer-9 uploadify

我正在尝试在 div 上绑定(bind) uploadify。
当我点击上传按钮时,它显示错误,如 SCRIPT5007: Object expected.

对于以下链接的演示检查,它在 ie9 中拖动 div 时产生了错误

<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.20/jquery-ui.js"></script>
<script type="text/javascript" src="http://www.uploadify.com/wp-content/themes/uploadify/js/jquery.uploadify.min.js"></script>

正文

<div class="container" id="container">
    <div id="uploadify-item"></div>
    This container is not draggable in IE9 but it works in Chrome and FF. Why not?
</div>

js

$('#uploadify-item').uploadify({
    'swf'      : 'http://www.uploadify.com/uploadify/uploadify.swf',
    'uploader' : 'http://www.uploadify.com/uploadify/uploadify.php'
});
$("#container").draggable();

引用:http://jsfiddle.net/axzdR/19/

最佳答案

IE9 似乎有一个 SWFUpload 嵌入的错误,因此如果你尝试 在元素上调用“getAttribute/removeAttribute/setAttribute”, 引发“预期对象”错误。我发现 cleanUp() swfupload.js 中的函数删除所有 js 函数,包括 "getAttribute/removeAttribute/setAttribute"从对象 DOM 中 IE9.

解决这个问题

在 SWFUpload.prototype.cleanUp 中

改变:

if (typeof (movieElement[key]) === "function")

收件人:

if (typeof (movieElement[key]) === "function" && key[0] <= 'Z') // Remove only Flash functions (starts with capital letters). 

uploadify 的补丁版本保存在这个位置

http://www.dariowiz.com/scripts/jquery.uploadify3.1Fixed.js

问候。

关于javascript - 在ie9中上传得到js错误: SCRIPT5007: Object expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16145365/

相关文章:

javascript - Nodejs Mongoose : Trying to save date in UTC Timezone but its saving in local time zone

html - Internet Explorer 10 为 CSS 元素分配异常高度

internet-explorer - 如何设置Http头X-XSS-Protection

html - IE9 : Issues with anchor tag sizing and li hover

javascript - 渐变过滤器可防止在没有文本的 IE9 DIV 中单击事件

javascript - 有没有办法使用 firebug 从 javascript 中的预定义函数输出结果?

javascript - jQuery 自定义验证不起作用

javascript - 延迟加载 jquery 后替换 $(document).ready(function()

javascript - window.open 不重用现有的命名窗口吗?

javascript - IE9 this = DispHTMLWindow2 在原型(prototype)函数中