better practice might be to keep all the major javascript in a more central place, like assets. but this code is very specific to the functionality on this page, so not sure if it needs to be central, since that will make it harder to see/debug what is happening on those pages.
better practice might be to keep all the major javascript in a more central place, like assets. but this code is very specific to the functionality on this page, so not sure if it needs to be central, since that will make it harder to see/debug what is happening on those pages.