http request with javascript instead of ruby