Because IE8 does not add the classname to the element when using new 
Element. It is a well documented bug in IE8 and you need to use 
addClassName('ghost') after the new Element bit


HTH

Alex Mcauley
http://www.thevacancymarket.com
----- Original Message ----- 
From: "Mojito" <tokyot...@gmail.com>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Monday, August 31, 2009 9:51 PM
Subject: [Proto-Scripty] Pure Prototype code was incompatible with IE8.


>
> My site works fine in FF and Safari. When tested with IE8, I get some
> error.  It says "ghost" and "ghostPosition" are undefined.  Why is my
> code incompatible with IE8 if my DOM reading and writing are purely
> done with Prototype?
>
> ++++++++++++++++++++++++++++++++++
>
> if($$('#lineup .ghost').length === 0)
> {
>    $('lineup').appendChild(
>        new Element('li', {'class' : 'ghost'})
>    );
> }
>
> var ghost = $$('#lineup .ghost')[0];
> var ghostPosition = ghost.cumulativeOffset();
>
> >
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to