ninoM said over 7 years ago on Page Specific Javascript in Ruby on Rails :

Thanks for providing the JS equivalent code!