make HTTP request using JavaScript instead of jQuery