IE7 does not extend element

54 views
Skip to first unread message

Zoltan

unread,
Dec 15, 2009, 9:47:09 PM12/15/09
to Prototype & script.aculo.us
I am trying to do something simple like:

function hide_it(el){
var my_el=$(el);
my_el.hide();//<---error:Object doesn't support this property or
method
Element.hide(el);<--- this works fine
}

It works fine in FF and Chrome, even in IE8, but IE7 sais "Object
doesn't support this property or method". I stepped into the function
with the debugger and it looks like the $ function finds the element
correctly by id but the Element.extend() function thinks that it is
already extended so it just proudly returns it.
For some reason in the Element.extend function, the
element._extendedByPrototype is an object and element.nodeType = 1 so
the condition in the first if is true because of any of these 2
conditions.

Please look into this matter.

Thank you.

T.J. Crowder

unread,
Dec 16, 2009, 6:44:16 AM12/16/09
to Prototype & script.aculo.us
Hi,

If that's really happening, it would be a bug (an obscure one). Can
you put together a small, self-contained test case demonstrating the
problem? (Here's[1] a starting point.) Since obviously, in the normal
course of things Prototype *does* work correctly on IE7, so clearly
there's something about your exact scenario resulting in this behavior
-- something that could be an error in your code, or a bug in
Prototype. The self-contained page reproducing the problem helps us
all figure out where the actual problem lies.

[1] http://proto-scripty.wikidot.com/self-contained-test-page

Also, what version of Prototype are you using?

Cheers,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com

Zoltan

unread,
Dec 17, 2009, 2:07:43 PM12/17/09
to Prototype & script.aculo.us
Believe it or not, including the prototype.js twice in the page messes
up IE7 (lol). It's weird that it works in IE8, FF and Chrome.
SO, DON'T include prototype twice!
Thanks for the help.
Reply all
Reply to author
Forward
0 new messages