Lasse Reichstein Nielsen <lrn@hotpop.com> wrote in message news:<hduu4vcs.fsf@hotpop.com>...[color=blue]
>
pi-ti@gmx.de (Julia Peterwitz) writes:
>[color=green]
> > I have a function that works with explorer but not with netscape.
> > The problem is the function at line 5.[/color]
>
> You don't say which Netscape. If it's Netscape 4, your options are
> very limited. If it's Netscape 6+, i.e., based on Mozilla, then
> you can pretty much fly :) I'll assume Netscape 6+.[/color]
yes, I thought about netscape 6+
[color=blue]
>[color=green]
> > 5 var elementText = eval(myElement.children["calDateText"].innerText);[/color]
>
> I see three problems:
> - innerText is IE only.
> - children is IE only.
> - eval is evil.
>
> There are different options, depending on how standards compliant you
> want to be. I'll go for full compliance with the DOM specification
> (i.e., avoiding innerHTML).
>
> A version that collects the string content of the calcDateText element
> (not recursively, so don't put the text to find inside tags).
> ---
> var font= myElement.getElementsByTagName("font");
> var elementText = "";[/color]
until here it works.
but the following doesn't start.
and I don't know why.
but there is no error message.
[color=blue]
> for(var chld = font.firstChild; chld; chdl=chld.nextSibling) {
> if (chld.nodeType == 3) { // text node
> elementText += chld.nodeValue;
> }
> }
> ---
>[color=green]
> > 11 <td id=calCell onclick='fSetSelectedDay(this)'>
> > 12 <font id='calDateText' onclick='fSetSelectedDay(this)'>[/color]
>
> The font tag is deprecated and you are not using any of its specific
> attributes anyway. Change it to a <span> instead, that is just what
> you need: a meaningless wrapper.[/color]
I removed the irrelevant attributes.
so I will use <font> further on.
[color=blue]
>[color=green]
> > 13 <script> myMonth[w][d] </script>[/color]
>
> The type attribute is required on script tags, so:
> ---
> <script type="text/javascript">
> ---
> Do you mean to document.write the value?
> ---
> document.write(myMonth[w][d]));[/color]
sorry I forgot to put the document.write around
13 <script> document.write(myMonth[w][d]); </script>
this function notes the days of the months, but this is irrelevant for
the problem. isn't it?
[color=blue]
> ---
> Where are "w" and "d" calculated? (Meaning Week and Day?)
>[color=green]
> > 14 </font>[/color]
> </span>
>
> /L[/color]