Update front.ctrl.php...

...to have the same behavior when you add inline JS in head or in footer.
Plus use the starts_with function of fuel PHP instead of the sub method