| Reference | Downloads | Github

"loading the experiment", but doesn't load

I’ve created an experiment that works without issue in PsychoPy but I’m having difficulty in making it work on Pavlovia. Normally Pavolvia provides an error message if there’s an issue, but for this particular experiment, it says “experiment loading” but nothing else (it doesn’t load). Does anyone know what the issue might be? The experiement contains a few small items of code (completing it in JS on PsychoPy in parallel to the Python code), so wonder if it’s anything in that which could be wrong - is there any way to tell? Thanks in advance, the experiment is

Hi James, I ran into the same problem. For me, it meant something was wrong with the JS code - Pavlovia doesn’t show you the error, though. Might be worthwhile going over your code again to make sure it is error-free.

Yes @JamesW , there is an error with the JS. If you press F12 when you run a study in a browser, you open developers tools and it will let you know what the error is. In this case, it is the following:

 if (corrans === key_resp_2.keys) {
      fbPic = "ExperimentStimuli/correctans.png";
  } else if (corrans === "left" {

There is a missing closing bracket on each of your else if statements.

Thanks @dvbridges for identifying that. I’ve corrected it but I’m still having problems. In it identifies the error in having “===”. I therefore changed it to “==” in - but that also results in an error. Any idea what may have gone wrong in my code? Many thanks again.

Hi @JamesW, looks like another syntax error, the closing brackets are in the wrong place. Take a look at the following corrected code:

 if (key_resp_2.keys === "down") {
      choosepic = "ExperimentStimuli/choosedown.png";
  } else if (key_resp_2.keys === "up") { // I removed a closing bracket from this statement

You will need to make this correction to your other statements as well.

Hi @dvbridges thanks very much for your help on this