Alister West

home is where your code is ...

JS Redirect

Add the $.redirect(url, params) to the query namespace

<script>
    $(function(){
        $('#selector').change(function(){
            // problem if 'id' option already exists
            var url = location.href + '?;id=' + $(this).val();
            location.assign( url );
        });
    });
</script>
<a href="#" onclick="location.assign( location.pathname )">reset</a>
<form>
    <select id='selector' name='id'>
        <option value='1'>one</option>
        <option value='2'>two</option>
        <option value='3'>three</option>
    </select>
</form>


// Put in jquery namespace
; jQuery.redirect = function(url, params) {

    url = url || window.location.href || '';

    url =  url.match(/\?/) ? url : url + '?';

    for ( var key in params ) {
        var re = RegExp( ';?' + key + '=?[^&;]*', 'g' );
        url = url.replace( re, '');
        url += ';' + key + '=' + params[key];
    }

    // cleanup url
    url = url.replace(/[;&]$/, '');
    url = url.replace(/\?[;&]/, '?');
    url = url.replace(/[;&]{2}/g, ';');

    // $(location).attr('href', url);
    window.location.replace( url );
};
By Alister West