Explore the community Forums Lectora Lectora Questions & Answers Importing a Javascript file at run time Reply To: Importing a Javascript file at run time

#373060 Score: 1
Profile photo of Darrel Somoza
Darrel Somoza
Member
contributor
friend finder
beginner
intermediate
junior moderator
advanced
wise owl
curious george
profile
209 pts
@Klaatu

You need to include the script tags with the source attribute. I believe you should be able to keep the external JS file anywhere as long as it is on the same server for security reasons.

The attached example shows that you can replace a lectora variable with a variable from external JS. This is good because you do not have to re-publish to change the variable.

I’ve asked this before. If a Trivantis application developer see this I would like to know what the thought process is behind the “bottom of file scripting” HTML Extension. Why does it work the way it does? JS script tags belong just above the closing body tag, not after the HTML closing tag as it currently works. Please fix it to follow proper web standards. If there is some other reason for having bottom of file scripting that I am unaware of then please add another option to add links to JS just above the closing body tag – call it “add external JS scripting”.

This post has received 1 vote up.
Attachments:
  1. example.zip