Java to print and/or email works in some but not all courses
Aug 09, 2016
Hi,
I've a course which uses Java Script to allow the learner to either email or print the contents of a text variable (this code was very helpfully sourced from these forums, thank you). This code did work originally in this one particular course I've been working on but now doesn't and I'm struggling to work out why.
I've copied the slide containing the java script into a new story and tested it through that and it works fine in that course. I've also taken the original course and removed 2 scenes to reduce the size of the course, and the Java Script works in that one too.
So basically I have 3 courses all containing the same slide, 2 of which work and the 3rd which doesn't. Can anyone suggest what might be the issue here? Could it be anything to do with the size? The offending course is just over 42Mb once published. The version of the course which works but has had 2 scenes removed is 29 Mb. Might just be a red herring but I'm grasping at straws now.
Any help very gratefully received.
Many thanks
7 Replies
Hi Anne,
To back up what Matthew said here is our information on Javascript best practices.
Thanks for this Matthew, I appreciate you taking the time to test it and reply. :)
I've uploaded all three courses containing the slide to our LMS so in theory they should all be working from the same starting point. I guess I must have something within the course which is stopping the java, I just need to work out what it is.
Thanks again.
Thanks Ashley. :)
Thanks Matthew, I'll give that a go.
For the email is it pulling text from inside the course? Their is a limit on the numbers of characters in mailto:
Thanks Phil,
I've finally managed to resolve the issue after a prolonged process of elimination. Hooray!
The problem was caused not by this bit of Java code but in fact by another bit of Java on another slide further on in the course which contained a parameter that was missing the "". The lesson here for me is that if you have Java in a course that is not coded correctly, it appears to prevent all Java from working throughout the entire course. Not being familiar with Java Script and also not having used Java in Storyline, I didn't expect that to be the case.
On the subject of the limit to the number of characters, do you mean there is a limit to the size of the data you can email from within the course? I did see that there is a limit to the number of characters of code that you can have, so assumed I was OK as I took the number of characters in the variable names to be what was counted and not the number of characters within the contents of the variable. Have I misunderstood this?
Thank you Matthew, Phil and Ashley for your replies, they are all greatly appreciated.
Happy to hear that Anne and glad you were able to figure it out!
I'll defer to Phil for the character limit, as I don't know about Javascript, but my guess is the "mailto:" set up is limited on number of characters based on a standard email address field/line? Total shot in the dark guess. :-)
This discussion is closed. You can start a new discussion or contact Articulate Support.