proper usage of jQuery.on(), and update javascript in views as well