Removed all the script code from the .jade files and added it into the side.js file.