hi,

use an type conversion (to javascript string) instead of string concat:

switch (String(cmd)) {
    ...
}

regards
Thomas

> <snip>
>
> function testSwitch() {
>       var cmd = getCmd("cmd");
>       switch(cmd) {
>           case "save": 
>                   print("request parameter was save");
>                   break;
>           case "delete": 
>                   print("request parameter was delete");
>                   break;
>               default:
>                   print("request parameter was none of the above");
>                   break;                      
>       }
> }
>
>
> function getCmd(name) {
>       return "" + cocoon.request.getParameter(name);  // --> we need to make 
> sure we get a native javascript object so our switch will work
> }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to