Use Axios as normal, CORS support is enabled.
<html>
<head>
<script src="https://unpkg.com/goodforms@0.9.2"></script>
<title>Simple Axios/CORS Test?</title>
</head>
<body>
<p>
Axios test
</p>
<div id="react-basic"></div>
<input type='text' name='email' id='email' onchange="handle_change(this.value)" /><input type='submit' />
<script>
</script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
function handle_change(param) {
console.warn("Handling change!");
console.dir(param);
axios.post("https://api.goodforms.com/verify", {
form_key: 'your_form_token',
email: param
}).then(function (result) {
console.warn("Got result from Axios!!!")
console.dir(result)
console.warn("And here's the data part:")
console.dir(result.data)
})
}
</script>
</body>
</html>Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article