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

#373125 Score: 1
Profile photo of Darrel Somoza
Darrel Somoza
friend finder
junior moderator
wise owl
curious george
209 pts

Darn, I usually have the .awt in my zip. Sorry, it’s in this one. The bottom of file scripting must have the script tag and source attribute – <script src=”main.js”></script> works.

The actual file you are referencing is just JavaScript, no markup.

I think you have it right above. Any problems let me know. If you want, give me a specific example of what you want to do and I’ll code up a sample.

Also keep in mind that you have to manually place the JavaScript file in the published content folder. I should have made that clear as well. Once done, though, you wont have to re-publish to change content in the external JS, just reload.


This post has received 1 vote up.
  1. example-1.zip