TImmo
08-11-2002, 06:42 PM
I have some week tried to find the way I can show different table in HTML page depending who visit in site. I using Javascript as login and in js file I change table content.
Finally I find from Javascript.com "Javascript and DHTML content" turorial one solution and with IE it works OK, but with NS4 I have problems.
I haven't put NS6 nor Opera support yet.
Here example and it works with IE, but how should I do with NS4?
<html>
<!-- Creation date: 11.08.2002 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example page</title>
<script language="JavaScript">
var text1 = new Array();
text="<table border='1' cellpadding='5' bordercolor='#0000FF'>";
text+="<col width='200'><col width='400'>";
text+="<tr><td width='206'>Customer1</td><td>Text for customers..</td></tr>";
text+="<tr><td width='206'>Customer2</td><td>Text for customers..</td></tr>";
text+="</table>";
text1[0]=text;
text="<table border='1' cellpadding='5' bordercolor='#0000FF'>";
text+="<col width='200'><col width='400'>";
text+="<tr><td width='206'>Dealer1</td><td>Text for dealers..</td></tr>";
text+="<tr><td width='206'>Dealer2</td><td>Text for dealers..</td></tr>";
text+="</table>";
text1[1]=text;
function change(grp){
if(document.all) {
content.innerHTML=text1[grp];
}
else if (document.layers) {
document.ns4content.document.ns4content2.document.write(text1[grp]);
document.ns4content.document.ns4content2.document.close();
}
else alert("Browser doesn't support this");
}
</script>
</head>
<body>
<form>
<input type="button" value="Customers" onclick="change(0)">
<input type="button" value="Dealers " onclick="change(1)">
</form>
<div id="content"></div>
<ilayer id="ns4content" width=600px height=700px><layer id="ns4content2" width=600px height=700px></layer></ilayer>
</body>
</html>
Appreciate of any solutions.
Finally I find from Javascript.com "Javascript and DHTML content" turorial one solution and with IE it works OK, but with NS4 I have problems.
I haven't put NS6 nor Opera support yet.
Here example and it works with IE, but how should I do with NS4?
<html>
<!-- Creation date: 11.08.2002 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example page</title>
<script language="JavaScript">
var text1 = new Array();
text="<table border='1' cellpadding='5' bordercolor='#0000FF'>";
text+="<col width='200'><col width='400'>";
text+="<tr><td width='206'>Customer1</td><td>Text for customers..</td></tr>";
text+="<tr><td width='206'>Customer2</td><td>Text for customers..</td></tr>";
text+="</table>";
text1[0]=text;
text="<table border='1' cellpadding='5' bordercolor='#0000FF'>";
text+="<col width='200'><col width='400'>";
text+="<tr><td width='206'>Dealer1</td><td>Text for dealers..</td></tr>";
text+="<tr><td width='206'>Dealer2</td><td>Text for dealers..</td></tr>";
text+="</table>";
text1[1]=text;
function change(grp){
if(document.all) {
content.innerHTML=text1[grp];
}
else if (document.layers) {
document.ns4content.document.ns4content2.document.write(text1[grp]);
document.ns4content.document.ns4content2.document.close();
}
else alert("Browser doesn't support this");
}
</script>
</head>
<body>
<form>
<input type="button" value="Customers" onclick="change(0)">
<input type="button" value="Dealers " onclick="change(1)">
</form>
<div id="content"></div>
<ilayer id="ns4content" width=600px height=700px><layer id="ns4content2" width=600px height=700px></layer></ilayer>
</body>
</html>
Appreciate of any solutions.