alert("http://site.ru/index.php?page=589&url=http%3A%2F%2Fdomen.ru%2F".replace(/(page=)(\d+)/, function(match, prefix, num) { return prefix + (Number(num) + 1); }));