title: Uncaught ReferenceError: canvas is not defined
body: <p>I'm a newbie at javascript so sorry if my question is trivial, but I've trying to create a jquery plugin, but when I load the page I get error:<br/></p>
  
  <pre><code>Uncaught ReferenceError: canvas is not defined
  </code></pre>
  
  <p>Here's the relevant parts of my code:</p>
  
  <p><br/>
  <strong><em>html:</em></strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta charset="utf-8"  http-equiv="Pragma" content="no-cache"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
      //tags...
          &lt;canvas id="myCanvas"&gt;&lt;/canvas&gt;
      //tags...
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong><em>plugin:</em></strong></p>
  
  <pre><code>    (function ($) {
          $.fn.myPlugin = function (...parameters...) {
              var ctx = this[0].getContext('2d');
              //
              body
              //
              return this;
          }
      })(jQuery);
  </code></pre>
  
  <p><strong><em>js:</em></strong></p>
  
  <pre><code>$(function () {
       //body
       $('#myCanvas').myPlugin(...parameters...);
       //body
  });
  </code></pre>