Fixed view and JS to be compatible with jQuery 1.8