Is it possible to move this pice of js to a file? For example then browser caching can kick in? Also keeps view code and js separated.