[dev] [commits] Horde Web Source branch master updated. e4888920a68a686e78bf33477e65006a4fb6b066

Michael M Slusarz slusarz at horde.org
Wed Apr 20 18:39:40 UTC 2011


Quoting "Michael J. Rubinsky" <mrubinsk at horde.org>:

> commit 25dffcd844e0a8e2b475b5855d72258fda121bfa
> Author: Michael J. Rubinsky <mrubinsk at horde.org>
> Date:   Wed Apr 20 14:27:10 2011 -0400
>
>     google analytics evidently needs to be inlined?
>
>  app/views/layout/home.html.php |   17 +++++++++++++++--
>  app/views/layout/main.html.php |   14 +++++++++++++-
>  2 files changed, 28 insertions(+), 3 deletions(-)

Looks like that javascript code is dynamically creating a script tag  
and inserting into the HTML document.  But scripts are loaded in  
parallel with the HTML document (at least in modern browsers) so by  
the time the script tag is injected into the HTML, the browser parser  
has already moved further down the HTML document and will not "see"  
the new tag.

Putting the javascript directly in the page blocks further loading of  
the page until the block is run, so that is why it will work when  
inlined.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list