How would I use XMLHttpRequest if I need to send some parameters that might contain '&' sign (without knowing which one or if any might contain it). Of course if there is an '&' sing it will break parameters on receiving end.
Is there a way to do this without using encodeURIComponent?
Normally I would do this:
var params = 'action='+foo+'&token='+bla+';
xhrRequest = new XMLHttpRequest();
xhrRequest.onreadystatechange = function() {
if (xhrRequest.readyState == 4) {
}
}
xhrRequest.onerror = function(e) {
};
xhrRequest.open('POST', url);
xhrRequest.setRequestHeader("Content-Type", 'application/x-www-form-urlencoded');
xhrRequest.send(params);