Using variable in Javascript

marco-meissner Community Member Posts: 17

I have a question regarding using a Lectora variable in Javascript. I want to use the variable that contains the current pagenumber (I'm using the german version, here it is called SeiteInKapital, so maybe PageInChapter or something like this in english). So I used this code to get the variable from lectora: 'var fragenr = (VarSeiteInKapitel.getValue() );'

The javascript is placed in an external html-object on a questionpage in lectora.

My problem=> The variable always contains the pagenumber of the previous page - not the current one. E.g. on page 2 the value is 1.

I would really appreciate any hint. I'm using Lectora Enterprise 4.1.

Many thanks,