Populate variables from the URL using JS instead of PHP