url parser that works uniformly on all javascript platforms