utneflyte Posted March 5, 2014 Share Posted March 5, 2014 (edited) Hi, I have opted to use the jQuery from Google's CDN instead of the local copy in the hopes of making the site load faster. The instructions on this page were followed: http://www.prestadb.com/snippets/load-jquery-using-google-cdn/ When I have CCC "smart cache for javascript" turned off. The first .js file listed is jQuery as expected, followed by the others: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"> <script src=".....> Everything good so far. But if I turn CCC on, the jQuery file is displayed after the combines .js files like this: <script src="http://domain.com/cache/bunchofnumbersandstuff.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> As you know, the jQuery must be first in order to work properly... so how can I make it that the jQuery file is listed first before the combined .js file? Thoughts? Thank you. Edited March 5, 2014 by utneflyte (see edit history) Link to comment Share on other sites More sharing options...
jd440 Posted June 29, 2014 Share Posted June 29, 2014 A solution exist by ovveriding /classe/media public static function cccJS($js_files) { [...] return array_merge(array($protocol_link.Tools::getMediaServer($url).$url), $js_external_files); } changed by public static function cccJS($js_files) { [...] return array_merge($js_external_files,array($protocol_link.Tools::getMediaServer($url).$url)); } Link to comment Share on other sites More sharing options...
Recommended Posts