JavaScript to control/update 2nd browser window opened from parent browser

shawnmac63 Community Member Posts: 1
Hello. I've been developing in Lectora for over a year but I am a novice when it comes to JavaScript.

A course I am working has an accessibility button on it that brings up new browser window containing the transcript of the narration. My client would like this secondary window to update the transcript info every time a user clicks the next button on the main course window bringing up the next slide. I believe this can be done with JavaScript, but I don't know the syntax to use. The transcripts currently all have their own html page, so basically what I want to have happen is when I hit the next button on the main course page, this would also trigger the secondary html window to go to it's next page. Any help would be greatly appreciated.




  • benpitman
    benpitman Community Member Posts: 763
    Recommend you post this in the General forum area where more people look. I do not know how to do this.
  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    Easy. The subtitles window is probably opened with something like this:

    childWindow ='');

    To change its contents, simply reload it with a new address:


    Here's a live demo:

    If this doesn't help you, you should probably hire a professional developer to do this.
  • benpitman
    benpitman Community Member Posts: 763
    You can do this with Lectora actions.

    Popup windows and launching windows share the variables. Use that to control.

    In the popup page put two On Timer actions that run every say 1/2 second that check a variable.

    One to Go To Next page if variable is 1.

    One to Go To Previous page if variable is -1.

    Then also have one On Show action before these two that sets the variable to 0 so it doesn't keep doing this.

    Then in launching window, when you want the popup to move forward or backward, just set the variable to 1 or -1,