problem accessing URL query parameters

146 views
Skip to first unread message

Becky Gilbert

unread,
Feb 9, 2018, 8:31:18 AM2/9/18
to JATOS
Hi JATOS users,

I'm having problems accessing URL query parameters using the jatos.urlQueryParameters object described here: http://www.jatos.org/jatos.js-Reference.html#original-url-query-parameters. I'm using JATOS version 3.1.12.

I'm trying to use jatos.urlQueryParameters in the first study component but it always returns undefined. For example, this:

$(function() {
    jatos
.onLoad(function() {  
       
....
        console
.log('URL parameters: ', jatos.urlQueryParameters);
       
....
    });
});

always gives me:
URL parameters:  undefined

This is true regardless of whether I run the study inside JATOS or outside (using a General Single or Personal Multiple worker link), and regardless of whether I add my own query string to the end of the link (e.g. "&foo=bar"). Any thoughts on what I might be doing wrong? Is there any more documentation on this that I might have missed, or examples studies on jatos.org that show how it's used?

Many thanks,

Becky

Kristian Lange

unread,
Feb 9, 2018, 4:28:28 PM2/9/18
to Becky Gilbert, JATOS
Hi Becky again,

I just tried the URL query parameters with both Personal Single Worker and Personal Multiple Worker and at least with my local JATOS it worked fine. Here is a screenshot:

image.png
What did your URL with query parameter looked like? Maybe you missed an '&'?

Best
Kristian

--
You received this message because you are subscribed to the Google Groups "JATOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jatos+un...@googlegroups.com.
To post to this group, send email to ja...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jatos/4ddb7892-533c-4aba-a437-135dcbf0c084%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Becky Gilbert

unread,
Feb 12, 2018, 6:50:17 AM2/12/18
to Kristian Lange, JATOS
Hi Kristian,

Thanks very much for looking into this. The good news is that this is now working perfectly. The bad news is that I can't reproduce the original problem (it just started working, so I guess I must have edited the file but I'm not sure what I changed). If I figure out what I was doing wrong, I'll post it here for the benefit of others.

Thanks again!

Becky


To unsubscribe from this group and stop receiving emails from it, send an email to jatos+unsubscribe@googlegroups.com.

Kristian Lange

unread,
Feb 12, 2018, 7:23:27 AM2/12/18
to Becky Gilbert, JATOS

Great it works now!
Best
Kristian


To unsubscribe from this group and stop receiving emails from it, send an email to jatos+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages