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.
on 2008-05-22 21:23
on 2008-05-22 21:36
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.
on 2008-05-22 23:05
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.
on 2008-05-22 23:42
Let me try to work up an example. The entire script is more then you need to see.
on 2008-05-23 00:17
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>
on 2008-05-27 15:22
Try eliminating global variable declaration (i.e. "elem", "parent", etc.) Also, check that all id's are unique on the page. Best, kangax