I am writting a large if / else tree in an existing website. My include libraries have to be put into the html program using a scripting language called SpeedScript. These includes bring in the login data that I am testing in my if tree. Instead of using the if/else I am trying a switch.
I need to know how to write this if/else tree / switch statement. I am brand new to Javascript. Here is the code I currently have that is not working.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>eSales Center - Customer Links</TITLE>
<META HTTP-EQUIV="Cache-Control" CONTENT="No-Cache">
<META HTTP-EQUIV="Pragma" CONTENT="No-Cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<SCRIPT LANGUAGE="SpeedScript">
{shared/esalesvars.i}
{shared/validate-session.i}
{shared/pp-global.i}
assign cLogin = if trim(cLogin) = "" then get-value("operinit") else cLogin.
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="javascript">
switch (cLogin)
{
case "12102":
<a href="/WI_testweb/12102.xls"><b><font size="3">Matrix</font></b></a><br />
break
case "134965":
<a href="/WI_testweb/12102.xls"><b><font size="3">Matrix</font></b></a><br />
break
case "13953":
<a href="/WI_testweb/12102.xls"><b><font size="3">Matrix</font></b></a><br />
break
case "13716":
<a href="/WI_testweb/13716.xls"><b><font size="3">Matrix</font></b></a><br />
break
case "111667":
<a href="/WI_testweb/111677.xls"><b><font size="3">Matrix</font></b></a><br />
break
default:
window.alert("This account does not have a custom matrix");
}
</SCRIPT>
</BODY>
</HTML>