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

jjeff - February 6, 2006 - 01:42

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

pauls - May 4, 2006 - 03:22

here is a patch i came up with that seems to function in ie 6 and doesnt break the existing ff compatibility.

<?php
    Element
.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

pauls - May 4, 2006 - 03:25

forgot to mention target file is spajax.js lines 41-53

#4

pauls - May 4, 2006 - 03:57

after reviewing the patch submission docs im submitting a cvs diff.

AttachmentSize
patch_001_0.txt 1.64 KB

#5

pauls - May 4, 2006 - 04:00
Status:active» needs review

status to patched. see previous attachment.

#6

pauls - May 4, 2006 - 04:13
Status:needs review» needs work

still need to get the detached menu to work.. changing status

 
 

Drupal is a registered trademark of Dries Buytaert.