// post survey data to the GameHouse New Data-Gathering end-point function postGhnewDataGathering(data, logname, location) { if (data !== null && logname !== null && location !== null) { // make sure the default fields are correctly set data.g_websiteid = 'zylom-classic'; data.logname = logname; data.location = location; // contentType must be `text/plain` otherwise the POST request will cause a // "preflight request" to be submitted which will be blocked by the GHNew app // See: https://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request $.ajax({ type: 'POST', url: 'https://eventhub.gamehouse.com/gathering/insertwrd', data: JSON.stringify(data), async: false, contentType: 'text/plain;charset=UTF-8' }); } }