Appending URL parameters to links
Generally speaking, doing something with jQuery will perform worse than doing that same thing directly through the DOM. In this case, using the following code inside the each will yield better performance:

this.href += window.location.search;


Note, however, that code will create an invalid URL if there is already a query on the original href.