I'm trying to detect a URL change but the URL has a dynamic value after the hash, for example: http://myurl/#!/contact/179593927.
I was able to make the below work but on http://myurl/#!/contact/ ONLY, but not on http://myurl/#!/contact/123456789.
$(window).on('hashchange', function(e){
 if (location.hash === '#!/contact/') {
    $('.controls-bar-1').appendTo('.contact-mod');
    $('.controls-bar-2').appendTo('.contact-mod');
  }
});
Please point me to the right direction.