added functionality to render JavaScript/JQuery into layout