.replace(/(^|[&?])id=\d+/, '$1id=' + id)
var search = location.search.replace(/[&?]id=\d*/, '') location.search = search ? search + '&id=' + id : 'id=' + id;