Solution 02

experiment.html should contain something like this:

<!DOCTYPE html>
<html>
    <head>
        <title>My experiment</title>
        <script src="https://unpkg.com/jspsych@8.0.2"></script>
        <script src="https://unpkg.com/@jspsych/plugin-image-keyboard-response@2.0.0"></script>
        <link href="https://unpkg.com/jspsych@8.0.2/css/jspsych.css" rel="stylesheet" type="text/css" />
    </head>
    <body></body>
    <script>
    var jsPsych = initJsPsych();

    var trial = {
        type: jsPsychImageKeyboardResponse,
        stimulus: 'nasa_proxima.png'
    };

    jsPsych.run([trial]);
    </script>
</html>

In this example, the image (nasa_proxima.png) should be in the same folder as experiment.html.

Your code may be different depending on where you have uploaded jsPsych and what your image is called, so if your code doesn’t work check these first.