Uploadify in ie9 getting js error : SCRIPT5007: Object expected

匿名 (未验证) 提交于 2019-12-03 02:06:01

问题:

I am trying to bind uploadify on div.
When I clicked on upload button it show me error like SCRIPT5007: Object expected.

For demo check below link which produced error on dragging of div in ie9

head

   

body

This container is not draggable in IE9 but it works in Chrome and FF. Why not?

js

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

Refer : http://jsfiddle.net/axzdR/19/

回答1:

IE9 seems to have a bug with SWFUpload embeds, whereby if you try to call "getAttribute / removeAttribute / setAttribute" on the element, an "object expected" error is raised. And I found that the cleanUp() function in the swfupload.js remove all the js functions including "getAttribute / removeAttribute / setAttribute" from the object DOM in IE9.

To fix this issue

In SWFUpload.prototype.cleanUp

Change:

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

To:

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

Patched version of uploadify is kept at this location

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

Regards.



回答2:

Try using lates jQuery (container is draggable in IE9, and "Object expected" error disapears)

    

Make sure you have installed Flash player for IE (it is separate install) It can be downloaded from here http://get.adobe.com/flashplayer/otherversions/

But even Unloadify demos is not working in my IE9 (I can click like a minute in Select files button with no result and suddenly with no reason it starts to work and opens select files dialog)



回答3:

You find the finally solution for this problem here >>> https://groups.google.com/forum/?fromgroups=#!topic/swfupload/57ySk2JoLbE



回答4:

It appears there is a problem in the sources of uploadify that conflicts with jquery UI in IE 9. Specifically in the swfupload utility. In order to fix it you need to do a little hack which appears to have detailed steps here: http://www.uploadify.com/forum/#/discussion/comment/19212

Sorry I can't validate this without setting up a whole test environment. Not something that can just be put in a JSFiddle. Good luck, let me know if you succeed.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!