[Mono-list] C# Patterns Web Site

Tracy Barlow tracy@aic.net.au
Tue, 01 Jun 2004 16:54:27 +1000


Mozilla and Mozilla based browsers, such as Galeon, and I reckon 
Netscape, will flag and error when it encounters the code eval(ref) the 
error return is "ReferenceError: Structure not defined"

the code below will work on all browsers, including IE (Internet Exploit 
Gateway).

<script language="JavaScript">
<!--

function ShowHide( ref )
{
 var color;
   if( ref == 'Structure' )
   {
     color = 'aa0000';
   }
   else
   {
     color = '007733';
   }

   var structure = document.getElementById(ref);
   var xstructure = document.getElementById("x" + ref);

   if (structure.style.display =='none')
   {
     xstructure.innerHTML = '<font face="Arial,helvetica" color=' + 
color + ' size=2><b><u>Hide code</u></b></font>';
     structure.style.display ='';
   }
   else
   {

      xstructure.innerHTML = '<font face="Arial,helvetica" color=' + 
color + ' size=2><b><u>Show code</u></b></font>';
      structure.style.display ='none';
alert("not None");
   }
}
//-->
</script>


I sent the code above to dataobject factory.

-- 
Regards

Tracy Barlow

TracyAnne Software

Phone      07 4124 5092
Mobile     0416 00 38 61
Email      tracy@aic.net.au
Web        www.tracyannesoftware.com/