<DIV>tag in netscape? but works in IE (see code)

D

D E

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">
<!---
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;

}
--->
</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">
<TR>
<TD CLASS="centerTD"><A HREF="index2.html"><DIV
ID="Enter"></DIV></A></TD>
</TR>
</TABLE>

</TD>
</TR>
</TABLE>

-----------------------------END CODE-------------------
 
D

DU

D said:
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">

Language is deprecated; type has superseded language and is both
backward and forward compatible.

Commenting out script code is unneeded unless you're looking to support
*very* old browsers.
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;


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..
}
--->
</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">

No need for a nested table here. You just make the markup code more
complex, longer to parse, load and render.
<TR>
<TD CLASS="centerTD"><A HREF="index2.html"><DIV
ID="Enter"></DIV>

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top