Fix for HTTP PUT failing if URL is not 127.0.0.1

When my local server runs, it uses localhost, so having the AJAX URL hard-coded caused it to
not work.  Instead, I've made it universal and now uses the location.origin to piece
together the URL.