Adding JavaScript in hook_init() is the spawn of the devil. Let's give it context with #attached libraries!

Comments

quicksketch’s picture

Fancy pants! Thanks Rob Loach!

steven jones’s picture

Very much almost perfect, except that you need to specify a version otherwise you get a notice. Patch attached that fixes that.

robloach’s picture

Assigned: robloach » Unassigned

Well done :-) . How has Hint module been lately? I know we're using HTML5 in Drupal 8 for it now :-) .

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Works fine here.

Please commit!