I still don't really understand the "defer" attribute, but I also don't see 
the advantage, when you can just put your scripts as late in the document 
as possible.

On Monday, November 7, 2011 7:50:18 AM UTC-5, Lasse Reichstein wrote:
>
> On Thu, Nov 3, 2011 at 8:36 PM, dtang85 <dta...@gmail.com> wrote:
> > I know that it is considered best practice to place your scripts at
> > the bottom of the page before the closing body tag. However, I started
> > using Require.js recently and the Google Maps API, and both tell you
> > to place your scripts in the head. Is there a reason for this or do
> > the examples just put it there because this was common practice in the
> > past?
>
> If you use the "defer" attribute on the script tag, it makes sense to put 
> it as
> early in the document as possible. Then the script can be loaded in
> parallel with
> the page being parsed.
>
> /L
>
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to