Add Parameter to all Links in a Page

Simple Javascript to a parameter to all link in a page.

<script type="text/javascript">
jQuery(document).ready(function ($) {
    $(function() {
        $("a").attr('href', function(i, h) {
            return h + (h.indexOf('?') != -1 ? "&var=value" : "?var=value");

i use this to create demo site 🙂

You can add this simple JQuery script in footer.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.