{"id":5039,"date":"2014-03-30T18:17:09","date_gmt":"2014-03-30T18:17:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/is-it-good-practice-to-make-canvas-a-global-object-in-javascript-collection-of-common-programming-errors\/"},"modified":"2014-03-30T18:17:09","modified_gmt":"2014-03-30T18:17:09","slug":"is-it-good-practice-to-make-canvas-a-global-object-in-javascript-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/is-it-good-practice-to-make-canvas-a-global-object-in-javascript-collection-of-common-programming-errors\/","title":{"rendered":"Is it good practice to make canvas a global object in JavaScript?-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to build a project in JavaScript that utilizes HTML5&#8217;s canvas tag. However, I&#8217;m running into a few issues due to referencing scopes in my objects\/prototypes.<\/p>\n<p>Is it a good idea (or rather, good practice) to just make the canvas element (however many of them there happen to be) global? I&#8217;ve been trying to avoid making global variables whenever possible, due to wanting to stick to an OOP-mentality, but I&#8217;m not finding many better solutions to this issue.<\/p>\n<p>Any feedback is appreciated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to build a project in JavaScript that utilizes HTML5&#8217;s canvas tag. However, I&#8217;m running into a few issues due to referencing scopes in my objects\/prototypes. Is it a good idea (or rather, good practice) to just make the canvas element (however many of them there happen to be) global? I&#8217;ve been trying to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5039","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5039"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5039\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}