Formula to JSON
Define formula using variables and transform it to JSON if it’s a valid math expression using Math.js
Define formula using variables and transform it to JSON if it’s a valid math expression using Math.js
Using fetch with asyncronous functions.
This way is even cleaner than using fetch by its own, check this out!
The easiest way to do a POST in JavaScript: using fetch.
AJAX request using ES6 Promises with fetch and XMLHttpRequest. Notice that the url needs https because we request from https and the server should allow all origins (Access-Control-Allow-Origin: *)
Fetch is simpler and cleaner, it avoid callback hell and having to remember the complex API of XMLHttpRequest.