It will be very much efficient if we get a render mode as ‘Script’ and a tab next to appearance tab for writing our javascript codes in a container as shown in below figures.