fix in communication: use encodeURI
this is needed e.g. when command socntain blanks
This commit is contained in:
@ -247,9 +247,10 @@ function updateValues(message, src) {
|
||||
function reqJSON(s, url, successHandler, errorHandler) {
|
||||
var xhr = typeof XMLHttpRequest != 'undefined' ? new XMLHttpRequest()
|
||||
: new ActiveXObject('Microsoft.XMLHTTP');
|
||||
url = encodeURI(url);
|
||||
if (debugCommunication) {
|
||||
console.log("%cto server (reqJSON): " + url,
|
||||
"color:white;background:lightgreen");
|
||||
console.log("%cto server (reqJSON): %s",
|
||||
"color:white;background:lightgreen", url);
|
||||
}
|
||||
xhr.open('get', url, true);
|
||||
xhr.onreadystatechange = function() {
|
||||
@ -273,9 +274,10 @@ function reqJSON(s, url, successHandler, errorHandler) {
|
||||
function reqJSONPOST(s, url, parameters, successHandler, errorHandler) {
|
||||
var xhr = typeof XMLHttpRequest != 'undefined' ? new XMLHttpRequest()
|
||||
: new ActiveXObject('Microsoft.XMLHTTP');
|
||||
url = encodeURI(url);
|
||||
if (debugCommunication) {
|
||||
console.log("%cto server (reqJSON): " + url,
|
||||
"color:white;background:lightgreen");
|
||||
console.log("%cto server (reqJSON): %s",
|
||||
"color:white;background:lightgreen", url);
|
||||
}
|
||||
xhr.open('post', url, true);
|
||||
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
|
Reference in New Issue
Block a user