Explore the community Forums Lectora Online Lectora Online Questions & Answers JavaScript stops working when title is published Reply To: JavaScript stops working when title is published

#438122 Score: 1
Profile photo of Robert Aung-Naing
Robert Aung-Naing
Member
beginner
intermediate
friend finder
profile
wise owl
contributor
19 pts
@raungnaing

Hi Sam,

The original script is not compatible with Seamless Play Publish. So if you had published with the option “Publish for Seamless Play” unchecked it would have worked fine. To make it work for both cases (Seamless Play and non-Seamless Play), you need to access the HTML elements using getDisplayDocument() function when using jQuery (eg: $(‘input:checked’,getDisplayDocument())).

I attached an updated version of your sample title; please give it a try. I also made another change: instead of putting the same code in each of the check boxes, I made it into a function called processCheckbox() and added to a second HTML Extension of type Header Scripting and call that function from each check box action. That way if you need to make a change to the script you only need to change in one place.

Regards,

Robert.

This post has received 1 vote up.