JavaScript encode the url we generate.