| re: <DIV>tag in netscape? but works in IE (see code)
D E wrote:[color=blue]
> Here is the problem. The following script/html code works in IE, not
> Netscape. The javascript portion produces the text to be dynamically written
> in the
> <A HREF="">HEREHEREHERE</A> portion...
> The HEREHEREHEREHERE writes fine in internet explorer, but does not appear
> at all in Netscape 7.1. I think it might have something to do with layers...
> How do I correct this? Thanks.
>
>
> -----------------------JAVASCRIPT PORTION:----------------------------------
> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="text/javascript">[/color]
Language is deprecated; type has superseded language and is both
backward and forward compatible.
[color=blue]
> <!---[/color]
Commenting out script code is unneeded unless you're looking to support
*very* old browsers.
[color=blue]
> function produceEnter() {
> //produces a random number between 1 and 8
> intInt = Math.round(Math.random() * 7 + 1);
>
> switch(intInt) {
> case 1: //Spanish
> langString = "[ENTRE](spanish)";
> break;
> case 2: //French
> langString = "[ENTRER](french)";
> break;
> case 3: //German
> langString = "[TRAGEN SIE EIN](german)";
> break;
> case 4: //Italian
> langString = "[ENTRARE](italian)";
> break;
> case 5: //Dutch
> langString = "[GA BINNEN](dutch)";
> break;
> case 6: //Portuguese
> langString = "[ENTRE](portuguese)";
> break;
> case 7: //English
> langString = "[ENTER](english)";
> break;
> case 8: //Norwegian
> langString = "[GÅ INN I](norwegian)";
> break;
> default: //English
> langString = "[ENTER](english)";
> break;
> }
> Enter.innerHTML = langString;
>[/color]
document.getElementById("Enter").childNodes[0].nodeValue = langString;
will work in MSIE 5+, NS 6.2, NS 7.x, Mozilla-based browsers, Konqueror
3.x, Safari 1.x, etc..
[color=blue]
> }
> --->
> </SCRIPT>
> -----------------------------HTML PORTION-----------------------
> <TABLE BACKGROUND="images/opener-waterfall.gif" ALIGN="CENTER"
> VALIGN="CENTER" BORDER="0" CELLPADDING="0" CELLSPACING="0">
> <TR>
> <TD>
>
> <TABLE BACKGROUND="none.gif" ALIGN="CENTER" VALIGN="CENTER">[/color]
No need for a nested table here. You just make the markup code more
complex, longer to parse, load and render.
[color=blue]
> <TR>
> <TD CLASS="centerTD"><A HREF="index2.html"><DIV
> ID="Enter"></DIV>[/color]
Improper nesting. You can not have a block-level element within an
inline element.
<a href="index2.html" id="idLangString"></a>
and then
document.getElementById("idLangString").childNodes[0].nodeValue =
langString;
will work again in will work in MSIE 5+, NS 6.2, NS 7.x, Mozilla-based
browsers, Konqueror 3.x, Safari 1.x, etc.. and in other W3C compliant
browsers.
You have many web design and markup syntax problems to deal with in that
code. None of your tables seems justified since you don't have tabular
data to render in the first place.
DU
</A></TD>[color=blue]
> </TR>
> </TABLE>
>
> </TD>
> </TR>
> </TABLE>
>
> -----------------------------END CODE-------------------
>
>[/color] |