1

I'm trying to improve my PageSpeed for my Magento website. I'm using GTmetrix about the test. I'm editing the file Head.php under app/code/core/Mage/Page/Block/Html

how this blog show me: http://www.magentocommerce.com/boards/m/viewthread/369412/#top

I replace this code in line 203:

// static and skin javascripts
            $html .= $this->_prepareStaticAndSkinElements('<script type="text/javascript" defer src="%s"%s></script>' . "\n",
                empty($items['js']) ? array() : $items['js'],
                empty($items['skin_js']) ? array() : $items['skin_js'],
                $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null
            );

            // If Mage is Admin
            if (Mage::app()->getStore()->isAdmin()) {
                $html .= $this->_prepareStaticAndSkinElements('<script type="text/javascript"  src="%s"%s></script>' . "\n",
                empty($items['js']) ? array() : $items['js'],
                empty($items['skin_js']) ? array() : $items['skin_js'],
                $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null
            );
            }

In this way the consecutive test is very good (100%) but The sliders on the page missing.

Can anyone help me? please

1 Answer 1

1

If you use async or defer loading of javascript, you must every js call which needs one of this js files making async, means you need to wrap it in a eventListener.

for Prototype this is

document.observe('dom:loaded', function(){
  // code
});
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.