Ajax: use anchor tag for parsing urls

This PR changes the Ajax URL parsing from using a regex to using an anchor tag. This should be simpler and more reliable.

Fixes https://github.com/jquery/jquery/issues/1875
/cc @dmethvin
I'm not sure of the style preference for breaking up long lines. With my tab width set to 2, this lined up with the start of `location.protocol`, but it looks pretty atrocious here.