More selective logic for onhashchange handlers.