I' trying to convert a array with some other arrays nested in it into a json string, by means of dojox.json.ref.toJson method.
However, when calling the method in which this is done, I get the error "Uncaught TypeError: Cannot read property 'ref' of undefined".
I' not sure if a require statement is needed as I' new to Dojo.
javascript Code:
function ajaxPOST(uRL, parameters) {
console.log(parameters);
var json = dojox.json.ref.toJson(parameters);
var xhrArgs = {
url: uRL,
postData: json,
handleAs: "text",
headers: { "Content-Type": "application/json", "Accept": "application/json" },
load: function(data) {
},
error: function(error) {
}
};
var deferred = dojo.xhrPost(xhrArgs);
}
How can I resolve this? Thanks