title: Set global variable inside `$(document).ready(function()`
body: <p>I try to set a global variable inside <code>$(document).ready(function()</code></p>
  
  <pre><code>$(document).ready(function(){
      $(".editCommentLink").on("click", function (e) {
          e.preventDefault();
          var window.comment_id = $(e.target).attr("id");
  </code></pre>
  
  <p>It throws error:</p>
  
  <pre><code>var window.comment_id = $(e.target).attr("id");
  Uncaught SyntaxError: Unexpected token .
  </code></pre>
  
  <p>When try to place <code>var comment_id</code> elsewhere, it constantly report <code>undefined</code></p>