Edit in JSFiddle

var myRouter = new Backbone.Router();

Backbone.history.start();

myRouter.route('*anyURL','anyURL',function(){
    console.log('called anytime the url changes to any url path');
});

//change url hash to "#foo"
window.location.hash = 'foo';
//change url hash to "#foo/boo/bar?coo=too&noo=loo"
setTimeout(function(){window.location.hash = 'qa';},2000);