I'm hacking around with devel.module trying to integrate sortable.js into it. Everything would be fine, except I cannot inject the Javascript include into the head.

I tried
drupal_set_html_head('<script type="text/javascript" src="/modules/devel/sortable.js"></script>');
in devel_query_table first, and when that didn't work
drupal_add_js('/modules/devel/sortable.js');
(which I didn't use at first as I didn't want the unnecessary JS file it would also include)

That didn't either... so I am stumped as to what the problem is. The template has been customised by someone else on the team, and its head looks like:

<head>
  <title><?php print $head_title ?></title>
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <?php print $head ?>
  <?php print $styles ?>
</head>

Is there any reason that wouldn't add the HTML to the head?

Many thanks!

Comments

pbowyer’s picture

Solved with the help of jeffContext :)

devel_exit() is called too late to add content to the section. By moving the JS-adding code to devel_init() I now have sortable tables.

Now to add a couple of stylesheet rules to neaten the table headers again!