PennController.GetURLParameterGlobal Commands

PennController.GetURLParameter( parametername )

Retrieves the value of a parameter that was passed after ? in the URL. This is particularly useful if you pass a uniquely identifying code to the URL when you recruit your participants, like http://spellout.net/ibexexps/PennController/Demo/experiment.html?id=abcdefgh

Example:

[js highlight=”7″ try=”data”]
PennController( “my trial” ,
newButton(“helloworld”, “Hello world!”)
.settings.log()
.print()
.wait()
)
.log( “ID” , PennController.GetURLParameter( “id” ) );
[/js]

Will add a column to each result line logged by my trial reporting the value that was passed after id= in the URL.