IsaKiko / D3-visualising-data

Lesson plans for teaching the basics of HTML, CSS, SVG, JSON, and JS (primarily D3.js), in order to create browser-based data visualisations.
http://isakiko.github.io/D3-visualising-data/
Other
35 stars 35 forks source link

Possible issue with the <script> location #14

Closed twitwi closed 9 years ago

twitwi commented 9 years ago

The lessons (javascript part) currently mentions that script can be put anywhere in the body. There are two possible issues:

A possible fix (if we want to avoid talking about onload [1] and other alternatives) would be to say that script can be anywhere in the head or body but that in this example it must be just before closing the body.

[1]: e.g. http://www.w3schools.com/jsref/event_onload.asp

IsaKiko commented 9 years ago

I didn't know! Thank you. I can't really find where we say that. Do you mean right at the start? It's definitively something we should mention in the lessons.

twitwi commented 9 years ago

This remark came to my mind when I read this “Everything between within the body will be interpreted as JavaScript code”

IsaKiko commented 9 years ago

Right. I'll append that.

IsaKiko commented 9 years ago

Thanks!