Two questions:

 

1. Is there a way in Witango to get the users browser and store it in a Witango var before processing the code – something like USER_AGENT?

 

2. This should be the most basic thing and yet I can’t seem to get it to behave. IE refuses to create a layer object and let me reference it. Says it is null and void.

 

Works fine in Firefox/Netscape

 

Eval() statement fails in IE .. browser complains stating the _expression_ return undefined or null as if the layer doesn’t exist. Can anyone see off hand what I am missing?

 

I even tried a direct command and it fails - document.all['Custom'].style.visibility = "visible";

 

Same error!

 

WTF!?!  =)

 

I dumped a bunch of the code below:

 

[JS Header Code]

 

<!--

if (document.layers){

              //Netscape 4 specific code

                          pre = 'document.';

                         post = '';

             }

             if (document.getElementById){

             //Netscape & Firefox specific code

                         pre = 'document.getElementById("';

                          post = '").style';

             }

             if (document.all){

             //IE specific code

                         pre = 'document.all.';

                         post = '.style';

}

 

             var currentLayer = 'Custom';

                        

             function showLayer(layer){

                         eval(pre + currentLayer + post).visibility = 'hidden';

                         eval(pre + layer + post).visibility = 'visible';

                         currentLayer = layer;

 }

 

 

 

Second option was: (made no difference)

 

if (document.all){

//IE4+ specific code

            pre = 'document.all[';

post = '].style';

}

 

 

 

[Body Code]

 

 

<script language="_javascript_">

if (navigator.appName == "Netscape")

{

             document.write('<table border=0 cellspacing=0 cellpadding=0 width=509 height=23><tr><td height=23><div id="SubMenu"><div id="Custom"><img src="" width=509 height=23 border=0 name="Custom"></div><div id="Tiara"><img src="" width=509 height=23 border=0 name="Tiara"></div><div id="Repair"><img src="" width=509 height=23 border=0 name="Repair"></div><div id="About"><img src="" width=509 height=23 border=0 name="About"></div></div></td></tr></table>')

             }

else

             {

             document.write('<table border=0 cellspacing=0 cellpadding=0 width=509 height=34><tr><td height=7><img src="" width=509 height=7 border=0></td></tr><tr><td height=23><div id="SubMenu"><div id="Custom"><img src="" width=509 height=23 border=0 name="Custom"></div><div id="Tiara"><img src="" width=509 height=23 border=0 name="Tiara"></div><div id="Repair"><img src="" width=509 height=23 border=0 name="Repair"></div><div id="About"><img src="" width=509 height=23 border=0 name="About"></div></div></td></tr><tr><td height=6><img src="" width=509 height=6 border=0></td></tr></table>')

             }

</script>

-->

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to