Copy link to clipboard
Copied
I know how to write javascript. I created an event on a slide and On Enter, I execute:
<script type="text/javascript">
alert('js doesnt work here');
</script>
That doesn't work. Syntax error. I try without the script tags = Syntax Error. I try without the semicolon = Syntax Error. I try adding it to the standard.js and calling it from the slide = Syntax Error I try adding it to the <head> in myproject.htm and call from slide = Syntax Error.
<script type="text/javascript">
function test() {
alert('js doesnt work here');
}
</script>
Why can I not get javascript to do anything at all? What is the correct syntax for the "Script_Window" ? Does it want the <script> tags? Does it want semicolons?
Been working on this for 2 hours trying to get a simple alert to say hi.
Or maybe it doesn't work with on enter/on exit events. I'll try buttons now, while I wait for a kind soul to hold my hand and teach me javascript.
Thanks!
Copy link to clipboard
Copied
Hello,
I'm only a newbie with JavaScript, but when I put this in the script window in Captivate, it works after publishing and in Preview in Browser mode:
alert("JS is working fine in Captivate");
Sometimes knowing too much is blocking, it seems that Captivate is adding all the other stuff, since you are typing in the Script window for JS.
BTW have a look at Jim Leichliter's blog, he is our JS-wizard:
Look at the 'Tuts' part,
Lilybiri
PS you create a function, but are not calling that function or did I read it wrong?