Re: ns4,6,ie5,6 and mozilla - Javascript
This is a discussion on Re: ns4,6,ie5,6 and mozilla - Javascript ; "Lasse Reichstein Nielsen" <lrn@hotpop.com> schreef in bericht
news:fzhuqo5b.fsf@hotpop.com...
> "Daniel van den Oord" <daniel304@planet-maps-on.nl> writes:
>
> > NS6 gives the error that the foldercontent has no properties
>
> Ok, that probably means that foldercontent is null or undefined.
...
-
Re: ns4,6,ie5,6 and mozilla
"Lasse Reichstein Nielsen" <lrn@hotpop.com> schreef in bericht
news:fzhuqo5b.fsf@hotpop.com...
> "Daniel van den Oord" <daniel304@planet-maps-on.nl> writes:
>
> > NS6 gives the error that the foldercontent has no properties
>
> Ok, that probably means that foldercontent is null or undefined.
>
> > I wanna support at least NS6, Mozilla and IE6 and maybe 5 the most
common
> > used once...
>
> Aiming for standards should give you Mozilla and Netscape 7 (and
> Netscape 6 if you avoid the bugs ... it is based on a pre-1.0
> version of Mozilla and has some bugs)
I know I'm trying to keep things save... I allready made a lot of
workarounds in other scripts
most of them to ugly to show though 
>
> >
> > >> var foldercontent = ns6 ? cur.nextSibling.nextSibling :
> > > cur.all.tags("UL")[0];
> > >
> > > var foldercontent;
> > > if (cur.nextSibling) {
> > > foldercontent = cur.nextSibling.nextSibling;
> > > } else if (cur.getElementsByTagName) {
> > > foldercontent = cur.getElementsByTagName("ul")[0];
> > > } else if (cur.all && cur.all.tags) {
> > > foldercontent = cur.all.tags("UL")[0];
> > > }
> >
> > Unfortunately this didn't work
> > The menu structure was very disturbed 
>
> Thinking about it, it is not that supricing. The oringinal expression
> didn't make much sense either:
>
> var foldercontent = ns6 ? cur.nextSibling.nextSibling :
> cur.all.tags("UL")[0];
You got that right it never worked here 
>
> If it is NS6, you let foldercontent be a sibling of the cur node. That
> is, they are nodes on the same level, having the same parent node.
> If it is not NS6, you find a child node of the cur node.
>
> So, which is it? Without knowing the structure of the HTML it is hard
> to guess which it should be, but since it works in IE, the problem is
> probably the nextSibling part. I would just skip it and use:
>
> var foldercontent;
> if (cur.getElementsByTagName) {
> foldercontent = cur.getElementsByTagName("ul")[0];
> } else if (cur.all && cur.all.tags) {
> foldercontent = cur.all.tags("UL")[0];
> }
>
> That should at least do the same thing in both Mozilla and IE.
Well I wished still nothing in foldercontent...
I'm sorry I totally forgot about the html code
here it is.. partially 
<div style="position:relative;left:-24">
<ul>
<li id="foldheader"> Modulen</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li id="foldheader"> Gebruikers</li>
<ul id="foldinglist" style="display:none" style=&{head};></ul>
<li id="foldheader"> Modulen</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a
href="javascript:menulinks('ed8019657149212393e5bf995c2c9431')">
Install</a></li>
</ul>
<li id="foldheader"> Servers</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a
href="javascript:menulinks('e4f2e95c8f850458f86a264bf792d0e8')">
IP-adressen</a></li>
<li><a
href="javascript:menulinks('11066639b238708c841da006e1166dda')">
Locaties</a></li>
<li><a
href="javascript:menulinks('3e8c653b2ee35059fc0a94d568953238')">
Servers</a></li>
<li><a
href="javascript:menulinks('1ce826ae5f9dbd78c19cab92da1f3330')">
Software</a></li>
<li><a
href="javascript:menulinks('e7d0cc30504eaa9be0f21e394370c217')"> Type
Software</a></li>
</ul>
<li><a
href="javascript:menulinks('e1c31bf61d9937925173075207517770')"> Quick
Links</a></li>
</ul>
</ul>
</div>
-
Similar Threads
-
By Application Development in forum Javascript
Replies: 0
Last Post: 06-20-2007, 08:42 PM
-
By Application Development in forum Perl
Replies: 2
Last Post: 04-16-2007, 09:19 AM
-
By Application Development in forum XML SOAP
Replies: 0
Last Post: 07-10-2006, 01:04 PM
-
By Application Development in forum Inetserver
Replies: 3
Last Post: 12-06-2004, 11:51 PM
-
By Application Development in forum IMAP
Replies: 0
Last Post: 10-13-2004, 02:07 AM