jsPsych/tests&examples/data-from-url.html
2016-01-05 12:09:17 -05:00

26 lines
568 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>
<div id="jspsych-target"></div>
</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>