Forum: Rails Spinoffs (closed, excessive spam) "Not implemented" error in IE for Element.up

Posted by louis w (Guest)
on 2008-05-22 21:23
(Received via mailing list)
I am getting and error "Not implemented" for the line that contains:
   parent     = elem.up('li');
This only happens in IE (both 6 and 7). Works fine in Safari and FF.

elem is a valid element, I can even output it to the console.

FYI: I am using firebuglite to be able to see errors and have a debug
console in IE.

Any idea what's up? Thanks.
Posted by Frederick Polgardy (Guest)
on 2008-05-22 21:36
(Received via mailing list)
My guess is that it's an element, but it's not extended by Prototype in 
IE.
That's a pretty typical issue.  Wrap it in an $(elem) first.

On Thu, May 22, 2008 at 2:23 PM, louis w <louiswalch@gmail.com> wrote:

> Any idea what's up? Thanks.
--
Science answers questions; philosophy questions answers.
Posted by louis w (Guest)
on 2008-05-22 23:05
(Received via mailing list)
Thanks for the tip. I tried this with no avail. I did some poking
around and there is one small discrepancy between FF and IE(7). It
looks like the item is different between the two, but it is the same
element (confirmed by tagName and className).

** FIREFOX
elem: [object HTMLDivElement]
elem tagName: DIV
elem className: node node-closed over

** IE7
elem: [object]
elem tag: DIV
elem class: node node-open over

Notice the missing HTMLDivElement in IE.
Posted by Justin Perkins (Guest)
on 2008-05-22 23:16
(Received via mailing list)
What does your complete code look like?

-justin
Posted by louis w (Guest)
on 2008-05-22 23:42
(Received via mailing list)
Let me try to work up an example. The entire script is more then you
need to see.
Posted by louis w (Guest)
on 2008-05-23 00:17
(Received via mailing list)
Here is more complete idea of the code:
As I said, IE7 triggers a 'not implemented' error on the line with
parent   = $(elem).up('li');
Also, I am on proto v 1.6.0.2

  <script language="javascript">

    var TreeNav = {

      init: function(tree) {
          $(tree).observe('click',
this.toggleChildren.bindAsEventListener(this));
      }

      , toggleChildren: function(evnt) {

          elem = Event.element(evnt);

          // Is this a node?
          if (!(elem.hasClassName('node-open') || 
elem.hasClassName('node-
closed'))) return;

          evnt.stop();

          console.log('elem: '+elem);
          console.log('elem tag: '+elem.tagName);
          console.log('elem class: '+elem.className);

          parent   = $(elem).up('li');

          console.log('parent: '+parent);

          return;

      }

    };


     document.observe('dom:loaded', function(event) {
       TreeNav.init('treeav');
    });
  </script>
Posted by louis w (Guest)
on 2008-05-24 02:01
(Received via mailing list)
any idea ?  :(
Posted by kangax (Guest)
on 2008-05-27 15:22
(Received via mailing list)
Try eliminating global variable declaration (i.e. "elem", "parent",
etc.)
Also, check that all id's are unique on the page.

Best,
kangax
Posted by louis w (Guest)
on 2008-06-11 23:47
(Received via mailing list)
Sorry for the late follow up. I just wanted to let any one know who
searches for this problem on here that it was what
kangax suggested. Global variable name conflicts.
This topic is locked and can not be replied to.