We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25799
    • 9 Posts
    I recently read this article (http://developer.yahoo.com/performance/) @yahoo.com. It is about loading websites faster (really interresting) . I have been playing with css spreads and i must admit that it really makes your website faster.

    One of the ’rules’ is that place a much javascrict as possible before the </body> tag, so the HTML/css is loaded before the javascript.

    So a (api)function like $modx->regClientCSS but than for javascript (javascipt is then placed before </body>).


    by.
      • 5274
      • 177 Posts
      Does that mean it’s best to move my <script type=’text/javascript’ src=’something.js’></script> calls from the <head> section to the the end of the <footer> section?

      I just tried it on one of my sites and nothing appears broken. Maybe I’ll start adding a new chunk to the end of my templates after the footer call and before the </html> call.
        • 14050
        • 788 Posts
        Quote from: RWQ at Dec 16, 2007, 07:20 AM

        I recently read this article (http://developer.yahoo.com/performance/) @yahoo.com. It is about loading websites faster (really interresting) . I have been playing with css spreads and i must admit that it really makes your website faster.

        One of the ’rules’ is that place a much javascrict as possible before the </body> tag, so the HTML/css is loaded before the javascript.

        So a (api)function like $modx->regClientCSS but than for javascript (javascipt is then placed before </body>).


        by.

        Just place a template variable right before the closing body tag, or create a plugin where you do something like:

        $modx->documentOutput = preg_replace("/(<\/body>)/i", $script."\n\\1", $modx->documentOutput);
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.