Optimizing the order of JavaScript is simple. You will need to cluster all JavaScript together as one group if possible, and let them execute first, before loading the CSS. This will benefit from any parallel loading of scripts which have an effect on loading speed. For example, if before it was:
<?php //javascript groups in the header placed here ?>
<link rel="stylesheet" href="http://www.php-developer.org/wp-content/themes/arras-theme.1.3.5/css/layouts/2c-r-fixed.css" type="text/css" />
<script type="text/javascript"> jQuery(document).ready(function($) { $('.sf-menu').superfish({autoArrows: false, speed: 'fast'}); }); </script> You can improve the first step by placing JavaScript above the CSS and grouping it (combining it) with the rest of the JavaScript. <?php //javascript groups in the header placed here ?> <script type="text/javascript"> jQuery(document).ready(function($) { $('.sf-menu').superfish({autoArrows: false, speed: 'fast'}); }); </script>
blog comments powered by Disqus |
|
|
|
|
|
|
|