Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

URL parameters undefined

Hi there,

I'm trying to get participant's prolific id through the URL, but (jatos.urlQueryParameters) renders "undefined" in the console. Similarly, jatos.urlQueryParameters is undefined. How to possibly go about this?


S

Comments

  • Dear S, 

    without much more context it's hard to know what the problem might be. The one thing that comes to mind is: do you call  jatos.urlQueryParameters.participant after jatos.onLoad?

    http://www.jatos.org/jatos.js-Reference.html#jatosonload

    It takes a while for jatos to initialize, so that might be it.

    Let us know if that doesn't help

    Best

    Elisa

  • Hi Elisa,


    thank for the quick reply. I was calling it the first thing in the script, but I put it at the bottom but it still failed to work. Finally I put it on the on_trial_start field of jsPsych, and it did work!

    I'm guessing this has something to do with the order in which jsPsych and jatos are compiling their code.


    Thanks for your help.


    Sankalp

  • edited March 2021

    Great that it works! The docs explain how jsPsych and JATOS interact. http://www.jatos.org/jsPsych-and-JATOS.html, in case you come across the same problem again

Sign In or Register to comment.