jsPsych/tests&examples/data-from-url.html
2016-08-15 17:17:51 -04:00

26 lines
592 B
HTML

<!doctype html>
<html>
<head>
<script src="js/jquery.min.js"></script>
<script src="../jspsych.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
<style>
img { width: 300px; }
</style>
</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>