# resizing\_html\_canvas\_element.htm

**URL:** <https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381>\
**Category:** Uncategorized\
**Created:** [March 23, 2016, 9:42pm UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381 "2016-03-23T21:42:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [March 23, 2016, 9:42pm UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381/1 "2016-03-23T21:42:35Z")

</div>

Hello & Thanks ,  
From your example/article 'resizing\_html\_canvas\_element.htm’  
I am getting this error: Uncaught SyntaxError: Unexpected token ILLEGAL  
From this statement: var myCanvas = document.getElementById(“canvas”);

```
window.addEventListener("resize", resizeCanvas, false);
 
function resizeCanvas (e) {
var myCanvas = document.getElementById(“canvas”);
 
myCanvas.width = document.documentElement.clientWidth;
myCanvas.height = document.documentElement.clientHeight;
}	

```

Can you tell me why ?  
Thanks…

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [March 24, 2016, 4:55am UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381/2 "2016-03-24T04:55:02Z")

</div>

Yeah, you copied over curly quotes from pasting the code into Word or something. You have quotes like `“` and `”`, but you should be using quotes like `"`.

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [March 24, 2016, 5:07pm UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381/3 "2016-03-24T17:07:40Z")

</div>

I think that may be a mistake in the tutorial. I have it as curly braces as well…which is really bizarre! It should be fixed now 🙂

---

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [March 24, 2016, 11:22pm UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381/4 "2016-03-24T23:22:01Z")

</div>

Ah , ThANKS

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [March 24, 2016, 11:25pm UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381/5 "2016-03-24T23:25:26Z")

</div>

This is the third time I’ve seen this come up this week. I kinda wonder how hard it would be for languages to recognize smart quotes in code. Probably a lot harder than it sounds like it should be from the outside, I’m sure.

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [March 25, 2016, 6:37am UTC](https://forum.kirupa.com/t/resizing-html-canvas-element-htm/634381/6 "2016-03-25T06:37:51Z")

</div>

I don’t think it’d be super hard, there’s just no convention for it and PL designers historically haven’t focused much on human factors or linguistic pragmatics. E.g. Ruby has `=begin` and `=end`; it’s hard to see how that’s much easier than using directional quotes.

The hard part would be retrofitting this sort of quote into many of the popular, existing languages. It’s like replacing the `var` or `function` keywords in AS4, or maybe even worse. There’s just so much momentum and existing code that changes need to be really compelling, and I’m not sure that problems like what we see above us here quite meet that definition.
