This is an example of what I'm trying to do in an "Evaluate JS" module:
Code: Select all
function paramJSON(inputJSON) {
var dumArr = [];
for (var ind in inputJSON) {
dumArr.push(ind+'='+inputJSON[ind]);
}
returnVal = dumArr.join('&');
return returnVal;
}
var http = new XMLHttpRequest();
var url = "https://example.com/request.php";
var paramsObj = {
param1 : "testing",
param2 : "one two three"
};
var params = paramJSON(paramsObj);
http.open("POST",url,true);
http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if (http.readyState == 4 && http.status == 200) {
data = JSON.parse(this.responseText);
[result] = data.result;
}
}
http.send(params);
When I call the number, it just hangs up when I get to this module. It doesn't give the usual "An error has occurred" message. Another Evaluate JS module works fine, but it just adds two numbers and assigns the result to another Fuse+ variable.
This script works fine when run in Firefox.
Our server also shows no sign that Fuse+ tries to contact it.
Does anybody have any idea what could be causing the problem?