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?:<
Don't you mean just location.href
?
This is assuming you are talking about window.location and not something else.
Returns a Location object, which contains information about the URL of the document and provides methods for changing that URL. You can also assign to this property to load another URL.
Location is not an element in the dom thus jQuery can not select it.
So your code would be like so:
var currentUrl = window.location.href;