Skip to Content
0
Former Member
Apr 27, 2005 at 07:58 AM

JS and cookies

11 Views

Hello,

I am new at JS and have some problems in evaluating a value returned from a function.

This is the case :

I call a JS-function which gives me a value back, in my case a language-key which is stored in cfoo.

In my page I want to evaluate this value and set a corresponding ABAP-variable like this :

var cfoo=csearch("c_spras");

document.write(cfoo); // N, F, E or D

switch (cfoo){

case "N":

<% spras = 'N'. %>

break;

case "F":

<% spras = 'F'. %>

break;

case "E":

<% spras = 'E'. %>

case "D":

<% spras = 'D'. %>

default:

<% spras = 'E'. %>

break;

}

</script>

The variable cfoo is filled with the correct value, i.e. N, F, E or D but the switch statement always returns the default value.

Can someone tell me what I am doing wrong ?

Thanks in advance,

Dirk.