I do not know why but I have problems with this code. The banner is displayed on every page although it has specified the attribute $(location).attr(\'href\') you can help me?:<
Try using var currentUrl = window.location.href instead. This will return the location of the current page.
var currentUrl = window.location.href