Bug Tracker

Changes between Initial Version and Version 1 of Ticket #14084, comment 12


Ignore:
Timestamp:
Jul 1, 2013, 3:25:47 PM (7 years ago)
Author:
timmywil
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14084, comment 12

    initial v1  
    33It is true that scripts running at the end of the body is basically the same as putting them at the end of the body, I would not officially recommend it because there are several conditions that could cause unwanted behavior. [http://stackoverflow.com/questions/1438883/jquery-why-use-document-ready-if-external-js-at-bottom-of-page This answer on SO] goes in more detail. Putting scripts at the end of the body is the same because ALL of the HTML source has been parsed by the browser. The point of the post is, be really sure you're not using something that hasn't been parsed yet (scripts using `document.write` or script tags anywhere besides the end of the body can cause errors).
    44
    5 Having said that, there is a [http://www.w3.org/TR/html5/syntax.html#the-end difference], according to the spec. Any scripts using the `defer` flag are executed _before_ the ready event, but not before scripts at the end of the body. Just good to be aware of that.
     5Having said that, there is a [http://www.w3.org/TR/html5/syntax.html#the-end difference], according to the spec. Any scripts using the `defer` flag are executed _before_ the ready event (under certain circumstances), but not before scripts at the end of the body. Just good to be aware of that.
    66
    77Finally, in oldIE, there was the [http://blogs.msdn.com/b/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx operation aborted event], but that could be avoided by ensuring the script tag's parent is actually the body.
     8
     9But yes, I'd be fine with defaulting to true.