better way of embedding assigned variables in the view file as js variables