Copy link to clipboard
Copied
Hello
Cap9. HTML5 only. Server=Linux(LAMP). No LMS.
I have a text file on the server named golive.txt which contains a single item of text, either the letter "Y" or "N".
When the Captivate project starts I need the project to read the text file.
If the text is "Y" I need a button in Captivate to be shown.
How can I do this?
I assume I will have to use Execute Javascript when the project starts.
I looked on the internet for Javascript examples of how to read a text file from a server, but they all seem to be too complicated, (arrays, libraries, etc), for such a simple need.
I don,t need to check for the file, it will be there.
I don't need to write to the file.
I don't need to display the contents.
Any help or suggestions will be much appreciated.
Thank you
Peter.
I figured it out.
Put on a Web Object pointing to golive.txt
Use Java to get the content of Web Object.
var myIFrame = document.getElementsByTagName("iframe")[0];
var content = myIFrame.contentWindow.document.body.innerHTML;
alert(content);
Copy link to clipboard
Copied
I had a thought.
If I use a Web Object to view the golive.txt file, I will have the text on a slide.
How can I read the content of the Web Object in Java?
Thanks.
Copy link to clipboard
Copied
I figured it out.
Put on a Web Object pointing to golive.txt
Use Java to get the content of Web Object.
var myIFrame = document.getElementsByTagName("iframe")[0];
var content = myIFrame.contentWindow.document.body.innerHTML;
alert(content);