Jump to content

Combine external javascript


Recommended Posts

The Firefox'es pagespeed extension suggests to combine external javascript. Rocky's perfomance tips mentions JMerge tool for doing this and I used it. But there are some javascript errors now. I am wondering whether I did it right. Here is what I did:

- made one script called 'global.js' using the tool and uploaded it to .js folder

- deleted the following code prom product.php:

$js_files = array(
   __PS_BASE_URI__.'js/jquery/thickbox-modified.js',
   __PS_BASE_URI__.'js/jquery/jquery.idTabs.modified.js',
   __PS_BASE_URI__.'js/jquery/jquery.scrollto.js',
   __PS_BASE_URI__.'js/jquery/jquery.serialScroll.js',
   _THEME_JS_DIR_.'tools.js',
   _THEME_JS_DIR_.'product.js'
);



- changed the 'header.tpl' by deleting:

>
[removed][removed]
[removed][removed]
[removed][removed]



and changed ....tools.js to ...global.js.

Now I get errors on product page: 'object expected', sometimes also 'tb_pathtoimage is not defined' and 'middle' is not defined.

Has anybody succeeded combining external javascript? How to do it properly?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...