Javascript no longer working
Jul 16, 2015
Hi all,
This used to work but not sure what changed. I would have an object in the slide that when clicked would go to a PDF (or web site). If the user did not click the button, my simple Javascript would alert then to click on the object and view the document before proceeding (when they clicked the Next button).
Here is the Javascript code:
alert("Please view the document.");
Used to work like a charm, haven't changed anything, just stopped working. I'm using Storyline version 1 and yes, it's online. When previewing on the hard drive, Storyline does recognize the Javascript and alerts that it is not active when previewing. That's the weird part.
Thanks in advance,
Scott
Digital Design Studio
West Los Angeles College
check out our blog - www.westladigital.com
11 Replies
Hi Scott,
Have you set flash player settings in browser? if not, set here and check once.
Hi Scott,
I'm not equipped to support Javascript, but you may want to also look at reviewing the information here.
If you are hosting it on a local drive, most modern browsers will not execute any javascript code. This is done to protect the user from malicious codes. If it was working before on a local drive and now it doesn't, then maybe the browser was updated or the settings were changed.
If you were hosting it on a site and it no longer works, then something else is the problem? Where any changes made to the SL file and then published. The way SL stores user javascript code is it places it all in one function. If you added any other javascript code in any other place and there is an error in it, then none of the javascript will work. So you'll have to check all your code.
If your are hosting it on a site, nothing was changed, and it just stopped working. I would check if uploading the original files again will fix the issue. If not, you may need to speak to your hosting provider.
Thanks Ashley,
That's the exact place where I learned the code to do this nice trick. It used to work and I have previous versions that worked but this version, no dice.
Thanks Jerson,
Not local drive, this is hosted, I've tried a few different servers, still not working. I'll check to see if the old version will work.
Sorry I couldn't be of more help Scott - but we have an amazing community, so hopefully the'll be able to assist here!
have you tried different browsers? If you have changed any other javascript be aware that any errors will break all the javascript (as Jerson pointed out).
I wouldn't do this in javascript much easier to just add another layer and better UI experience rather than throwing up an alert window
Thanks Phil,
That's a good idea with the layer, I'll try that next.
Best,
Scott
Glad you got the help you needed here Scott!
same thing with me i.e. javascript stopped working, coould be becuase multiple javascript libraries are loaded... see page source. I've found no solution yet
Hi Chris,
This discussion is a bit older - so I'd want to know what version and update of Storyline you're using? Javascript isn't something we can offer support for (the code itself) so I'd also suggest sharing the code that isn't working here with the community so that they could take a look and offer any ideas.
If you think something changed in Storyline as the code worked previously, we can also take a look at that - and it'd be something I'd suggest doing in a Support case. You can use that link to share your files with our team or I can start a case for you. Just let me know!
This discussion is closed. You can start a new discussion or contact Articulate Support.