The original AJAX request had a dataType of \'text\' but then I get a CORS error. So, I changed the dataType to jsonp as I read that is the way to fix the CORS erro
jsonp