mark4asp wrote:
Every time the function below is called I get the alert. So I put a
deliberate error in there and I check the value of
(reportType=='MANDATE') in Firebug, which is found to be true. But
still the alert comes up. Why?
I just tried this and it alerts Mandate on IE and FF2.
<html><body>
<script language="javascript">
function showReport(id, reportType, bHighlightRow)
{
var url;
switch (reportType) {
case 'INVESTOR':
alert("Investor")
break
case 'SUMMARY':
alert("Summary")
break
case 'MANDATE':
alert("Mandate")
break
default:
alert('default')
}
}
showReport(5843,'MANDATE');
</script></body></html>
Is your code being compressed/minified and the lack of semi-colons is
catching you out? Although I would expect Firefox to be very verbose
about it in the Error Console if that were the case.