Enquiries of failures in loading external JS & CSS in Cognition.run #1684
-
Hi all, I would like to ask about the format of loading external JS & CSS in Cognition.run. It is my first time to use Cognition.run as the platform of the online research. I have written the experiment with jsPsych in Visual Studio on local and it run well on local. Then I copied the code to the cognition.run and uploaded the JS & CSS as instructed. However, it seemed that JS & CSS were not correctly loaded and the experiment didn't work as expected, it showed a blank screen and the console of the webpage confirmed that. Meanwhile, the images and other stuffs were correctly loaded. I would like to ask if someone could help me with some instructions or some other ways to show me the examples of the correct format to use the external JS & CSS in Cognition.run. Thank you so much! Here are the codes and the error report in Cognition.run.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
In cognition.run, the code editor is just for JavaScript, not HTML. So you'll want to delete everything before |
Beta Was this translation helpful? Give feedback.
In cognition.run, the code editor is just for JavaScript, not HTML. So you'll want to delete everything before
var timeline
(line 25), as well as any closing HTML tags at the end of your code. You can put the CSS in the style tags into a CSS file and then upload that in the upload JS/CSS section.I hope this helps!