automatically add script tag into the main page when using the view subgenerator