[OE-2664] first bash at standardising the way javascript is passed through from the controllers.