Lightweight URL manipulation with JavaScript