In my app I have jquery that is specific to each page, that is scripts that are used strictly on one page. Is there a way to set a scope that I can work within to avoid any id/class collisions or behaviour creeping from one page to another?
I could do this, for example by specifying the wrapper div for the specific page
$(function(){
$('#thing_page input.finder').focus(function(){ ... })
});
but I would need to prepend all the event bindings with the name of the page wrapper, which is a bit annoying.
For those who don't know, rails compresses all the javascript files in to one, which I like. Otherwise I could just include each file on a specific page.