Skip to main content
Inspiring
June 10, 2016
Question

Make Javascript output appear in existing window

  • June 10, 2016
  • 1 reply
  • 148 views

My ultimate goal is to replace a string generated as a Captivate 8 quiz answer into a format that is useful for my learners.

So far, I have been able to do this using the following script:

var str = "systemanswer";

var res = "myanswer";

str.replace(res);

However, I am virtually illiterate in Javascript, and cannot figure out what script to use to make the new string appear in the same location as the replaced string on my slide.

Using  document.write(res); makes the replacement string "myanswer" appear in a new window, but then the learner cannot see the content of the slide in which the original string "systemanswer" appeared.

I would be so grateful if anyone could suggest a line of code that would take care of this issue.

Best,

Laura

    This topic has been closed for replies.

    1 reply

    TLCMediaDesign
    Inspiring
    June 15, 2016

    What do you mean by a quiz answer?