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
Yeah, did some head-scratching on this one and left it as-is with an enhanced comment.