Ajax: use anchor tag for parsing urls

Fixes gh-1875
Closes gh-1880