get javascript working in view