Explore the community Forums Lectora Lectora Questions & Answers Web window communicate with Lectora course? Reply To: Web window communicate with Lectora course?

#429712 Score: 1
Profile photo of Sergey Snegirev
Sergey Snegirev
Member
contributor
intermediate
advanced
friend finder
lab member
junior moderator
advocate
LUC16
LUC16 Attendee
wise owl
339 pts
@ssneg

1. Yes it is possible to communicate from a web window to the parent Lectora page.
2. Yes it is possible to use JS in your web window to alter a Lectora variable.
3. Depending on whether the contents of your web window is hosted with the course or remotely, communication approach will vary. Locally hosted content can directly access parent window variables. Remote content will not be able to do so. You will have to set up communication using postMessages. In short, the web content will send postmessages to parent Lectora page, and a local script in the parent page will catch those messages and act on them, e.g. change Lectora variables. Generally speaking, the latter is the “correct” way of doing this even if your web window content is not hosted remotely.

This post has received 1 vote up.