Limit JavaScript to one block (prevent layout changes) | XM Community
Skip to main content
Solved

Limit JavaScript to one block (prevent layout changes)

  • July 9, 2020
  • 2 replies
  • 51 views

We are conducting a study in which one part is an IAT that was created with the web app iatgen and inserted into the JavaScript of a Text Entry Question. Through that the layout of the entire survey has changed. We would like to limit the JavaScript to the blocks which contain the IAT and leave the rest of the survey unchanged. However, we are unsure why the rest of the study is even affected. We guessed that it might be due to the following code about QuestionID:

var qID =this.questionId;

qID = qID.replace("QID", '');

qID = parseInt(qID);

I uploaded one of the 7 parts of the code. Any help is appreciated!
IAT_part1.txt

Best answer by TomG

The only thing that portion of the code does is populate the variable qID with the number of the QID.

If the entire layout of the survey is impacted it is probably something in Custom CSS that is doing it.

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • July 10, 2020

The only thing that portion of the code does is populate the variable qID with the number of the QID.

If the entire layout of the survey is impacted it is probably something in Custom CSS that is doing it.


  • Author
  • July 10, 2020

Thank you very much for the tip! A simple layout change did the trick.