implemented loading of javascript template from the server side
adjusted to fit new development environment