Explore the community Forums Lectora Lectora Questions & Answers Another JS scoping problem Reply To: Another JS scoping problem

#365561 Score: 0
Profile photo of Tim K
Tim K
friend finder
junior moderator
wise owl
curious george
Group Member
354 pts

I suppose the code you’ve posted isn’t all that’s happening. How does the value from the database come into the Lectora variable? It should be possible to run this part on page1.

On page2 there should be no need to contact the database any more. Mind you do have to do something with the Lectora variable on page2 before you can access it with javascript, otherwise it won’t exist. Create an action to modify the variable on page2, so Lectora knows you need it. There’s no need to run that action, you can put it into an action group that’s never run.