jsPsych/examples/data-from-url.html
2020-05-26 20:20:03 -05:00

22 lines
487 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<link rel="stylesheet" href="../css/jspsych.css">
</head>
<body>
<p>The URL variable should be logged to the console</p>
</body>
<script>
if(typeof jsPsych.data.getURLVariable('v1') == 'undefined'){
window.location = window.location + '?v1=abc&v2=def';
}
console.log(JSON.stringify(jsPsych.data.urlVariables()));
console.log(jsPsych.data.getURLVariable('v1'));
</script>
</html>