We are struggling around here with SVG in IE8. Amongst other approaches we'ld also like to try the SVG Web Toolkit. In it's quick start guide they say:

To use SVG Web, you must drop a script tag into your HTML page. This must be the first script tag on your page.

The JS is now loaded by a custom module. I tried

drupal_add_js($modulepath . '/libraries/svg.js', array(
   'group' => JS_LIBRARY,
   'weight' => -1000,
   'every_page' => TRUE));

When I vary these options it's sometimes higher, sometimes lower. The above code makes it the highest I can get it. But there still are quite a number of scripts loaded prior to it.

How can we ensure the svg.js to load first? Is there maybe a way to do it with drupal_add_js in our custom module?


Can you try with hook_js_alter


You can install the js_injector module in which you can choose the priority of your .js file

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.