对于一些大学课程,我正在尝试使用 jQuery 和 sessionStorage 以便我可以跨页面存储数据,但是在执行以下行时它会崩溃:
eDiffpl = eventDate.getTime() - pageLoadDate.getTime() – benchTime;
错误说: Uncaught SyntaxError: Unexpected token ILLEGAL
这是完整的脚本:
var pageLoadDate;
var benchTime;
var eventDate;
var eDiffpl;
$(document).ready(function() {
pageLoadDate = new Date();
$("*").click(function(e) {
// Stop the function propagating up the DOM tree
e.stopPropagation();
// Get the interaction time
eventDate = new Date();
// <p data-islink="islink">dduiduihd</p>
// Check if this is the link we want
if ($(this).data("footballLink") != undefined) {
// The right link has been clicked
benchTime = benchmarkDate();
eDiffpl = eventDate.getTime() - pageLoadDate.getTime()– benchTime;
sessionStorage.myTester = Number(sessionStorage.myTester) + eDiffpl;
// Then move to next page of experiment
window.location.url = "feedback_page.html";
}
} else {
// An incorrect part of the page has been clicked
sessionStorage.errorCount = Number(sessionStorage.errorCount) ++;
console.log(sessionStorage.errorCount);
}
});
});
基准日期函数:
function benchmarkDate()
{
var start_date;
var end_date;
start_date=new Date(); // 1
// 100
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 200
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 300
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 400
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 500
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 600
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 700
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 800
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 900
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
// 999
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date(); end_date=new Date();
var diff = (end_date.getTime() - start_date.getTime());
//Debug line below
//alert("start: " + start_date.getTime() + "\nend: " + end_date.getTime() + "\nDiff: " + diff)
return diff;
}