I am new to JavaScript. How can I add mode: no-cors
to my XMLHttpRequest
in JavaScript?
For example, to this code:
var xhr = new XMLHttpRequest();
xhr.open("POST", yourUrl, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
value: value
}));