Retrieving a variable from JS

Hi there,


I am wondering if it is possible for lectora to be able to retrieve a variable from a web window page.


I have created a small HTML page with a javascript variable within this page. This has been added to lectora in a web window. I would some how like to retrieve the value of the variable within the HTML page via lectora and display this in a label text field on the lectora page itself (not within the web window).


Any ideas?

Thanks Calloom

Discussion (1)

Sure, why not. Find out the element id of the web window (iframe?), use getElementById(), then access the variable as usual.


Smth like this:


var mywebwindow = document.getElementById('yourwebwindowidgoeshere')

alert(mywebwindow.myvariable)

Discussions have been disabled for this post