$("a").attr("href", function () {
    var url = this.textContent;
    var index = url.indexOf("?");
    var path = url;
    if (index != -1) {
        path = url.substr(0, index);
        var search = url.substr(url.indexOf("?") + 1);
        var params = search.split("&");
        for (var i = 0; i < params.length; i++) {
            var array = params[i].split("=");
            if (i == 0) {
                path += "?";
            } else {
                path += "&";
            }
            path += array[0] + "=" + encodeURIComponent(array[1]);
        }
    }
    return path;
});