Creating a JavaScript function to handle XMLHttpRequest responses