I am trying to use a callback function to place data into an array. When i try to call my callback function 'myCallback' i get an error saying TypeError: callbackFunction is not a function
. Here is an example of what the code looks like.
var content = [];
var function1 = function(){
var function2 = function(){
query = function(){
//CAML code
}
success = function(callbackFunction){
callbackFunction("text");// TypeError: callbackFunction is not a function
}
failure = function(){
//Error code
}
}
function2();
runQuery(one, query, success, failure, two);//Main function
}
function1();
function callbackfunction(data){
content.push(data)
}
I am following THIS Stack Overflow answer. Maybe I am getting something confused? Not really sure why it is throwing me the error when it is clearly defined in the code.
Thanks pals.