title: using jquery and session storage but system crashes
body: <p>For some university coursework I am trying to use jQuery and sessionStorage so that I can store data across pages, however it crashes when the following line is executed:</p>
  
  <pre><code>eDiffpl = eventDate.getTime() - pageLoadDate.getTime() – benchTime;
  </code></pre>
  
  <p>error says: Uncaught SyntaxError: Unexpected token ILLEGAL</p>
  
  <p>Here is the full script:</p>
  
  <pre class="lang-js prettyprint-override"><code> 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();
  
         // &lt;p data-islink="islink"&gt;dduiduihd&lt;/p&gt;
  
         // 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);
       }
     });
   });
  </code></pre>
  
  <p>benchmarkDate function:</p>
  
  <pre><code>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;
  }
  </code></pre>