actually, looking at this further, I needed to add this line to my
Element function:
    if (element) global.Element.prototype = element.prototype;

it looks like it was added recently in prototype as well, maybe for
IE8 specifically.

On Sep 10, 9:09 pm, Viktor Kojouharov <vkojouha...@gmail.com> wrote:
> actually, while creating the test, I started cutting unrelated parts
> from my included scripts, and once I removed my overwrite of the
> Element function (which was overwritten between the two method
> additions), the second set of methods were defined.
>
> My overwrite is this, in case anyone is interested in to why it was
> causing problems with IE8  and addMethods alone:
>
> if (Prototype.Browser.IE)
>   (function() {
>     var element = this.Element;
>     this.Element = function(tagName, attributes) {
>       attributes = attributes || { };
>       tagName = tagName.toLowerCase();
>       var cache = Element.cache;
>       if (Prototype.Browser.IE) {
>         var attributeString = '';
>         for (var key in attributes) {
>           if (typeof attributes[key] == 'string') {
>             var name = key == 'className' ? 'class' : key ==
> 'htmlFor' ? 'for' : key;
>             attributeString += name + '="' + attributes[key] + '"';
>             delete attributes[key];
>           }
>         }
>         tagName = '<' + tagName + ' ' + attributeString + '>';
>         return Element.writeAttribute(document.createElement(tagName),
> attributes);
>       }
>       if (!cache[tagName]) cache[tagName] = Element.extend
> (document.createElement(tagName));
>       return Element.writeAttribute(cache[tagName].cloneNode(false),
> attributes);
>     };
>     Object.extend(this.Element, element || { });
>   }).call(window);
>
> ^ the above is written to achieve this: new Element('div',
> {onclick:"alert(1)"}), or adding string callbacks when creating an
> element (which I need). I will just make this function exists in IE6 &
> 7, but not 8 for now, unless someone can tell me what exactly is
> causing this.
>
> If someone wants to, I can still attach a simple test for this.
>
> On Sep 10, 4:07 pm, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
>
> > Hi Viktor,
>
> > Could you put together a small, self-contained test case that
> > demonstrates what you're seeing and open a ticket in Lighthouse with
> > it?[1]
>
> > [1]http://prototypejs.org/contribute
>
> > Thanks in advance,
> > --
> > T.J. Crowder
> > tj / crowder software / comwww.crowdersoftware.com
>
> > On Sep 10, 11:56 am, Viktor Kojouharov <vkojouha...@gmail.com> wrote:
>
> > > Hello,
>
> > > I'm getting a rather weird error in IE8 specifically (not in IE7 or
> > > IE6). In two places I add additional element methods using
> > > Element.addMethods. The first time this is done, the added methods
> > > appear as Element.someMethod and $(element).someMethod. However, the
> > > second time additional methods are added, these methods appear only as
> > > Element.someMethod2. $(element).someMethod2 is undefined in that case.
> > > Not sure what's going on here, but as my code appears valid in all
> > > other browsers I tested it in (the other IEs, FF, Chrome), my guess is
> > > that there's something wrong with proto 1.6.1. In addition, I did not
> > > exhibit this behaviour with 1.6.0.3
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to