Javascript errors in IE
budda - February 6, 2006 - 01:10
| Project: | S/P Ajax |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs work |
Description
Getting Javascript error dialogs in IE6, could be caused by the combination of this and the related menus module. For example clicking on the 'create content' menu item causes a this.parentNode is null error.

#1
Yes, I need to take a look at the way things are (not) working in IE. Please post more errors here if you find them. Hopefully I will have a chance to take a look this week.
-Jeff
#2
here is a patch i came up with that seems to function in ie 6 and doesnt break the existing ff compatibility.
<?phpElement.addClassName(lis[lis.length - 1], 'last');
- firsta.flip = function() {
+ firsta.onclick = function() {
+ if (this.parentNode){
myul = this.parentNode.getElementsByTagName('ul')[0];
vis = Element.visible(myul);
Element.removeClassName(this, vis ? 'expanded' : 'collapsed');
Element.addClassName(this, vis ? 'collapsed' : 'expanded');
Element.removeClassName(this.myli, vis ? 'expanded' : 'collapsed');
Element.addClassName(this.myli, vis ? 'collapsed' : 'expanded');
new Effect.toggle(this.parentNode.getElementsByTagName('ul')[0], 'blind');
+ }
+ return false;
}
- Event.observe(firsta, 'click', firsta.flip);}
+ Event.observe(firsta, 'click', firsta.onclick);}
}
?>
you can actually safely remove the line:
Event.observe(firsta, 'click', firsta.onclick);
and ie 6.0 and the latest ff still function correctly.
not sure if it is in there for further compatibility beyond those two..
#3
forgot to mention target file is spajax.js lines 41-53
#4
after reviewing the patch submission docs im submitting a cvs diff.
#5
status to patched. see previous attachment.
#6
still need to get the detached menu to work.. changing status