oTree Forum >

Calling a variable saved in previous page - Otree

#1 by Arsil (edited )

Hi Everyone, 

Can anyone please share a snippet or code example of how we can call a variable value (player level) stored in an earlier page in the Javascript of a later page in the same app.

Regards,
Arslan

#2 by Chris_oTree

Use js_vars in the second page to send that field to the javascript code: https://otree.readthedocs.io/en/latest/templates.html?highlight=js_vars#passing-data-from-python-to-javascript-js-vars

#3 by Arsil

Thank you so much Chris. I have tried this and it worked.

#4 by Arsil

Thank you so much Chris. I have tried this and it worked.

Write a reply

Set forum username