I read that you should define your JavaScript functions in the tag, but how does the location of the (whether in the
If your script refers to an ID on the page and the page has not been rendered (i.e. script is before HTML, or your script is executed with onload, rather then the DOM is ready) you can also get an error.