Added a JS function to create an AJAX request