1

I have a 2 modules which has javascript files modify the height of an element (through jquery).

module one set the height to 100px module two set the height to 200px

I seems like the module one is fired after module two. I need the js file of module two to be fired after the js file of module one. This is to change the weight of the js files.

I included the js file in the module_one.info file like this:

scripts[] = js/myfile.js

Can I do this?

Should I add the js files in myTheme.info ?

2

You can change the module weight in your system table in the data base. This will reorder the execution of the modules and also the inclusion of js.

You can update the weight via myphp admin or you can do it via a custom modules .install file in a hook_install. for example:

db_update('system')
 ->fields(array(
   'weight' => 10,
 ))
 ->condition('name', 'module_name')
 ->execute();

Replace module_name with the name of the module you would like to delay.

Clear all cache afterwards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.