I\'m trying to pass in a function to run when the AJAX call is successful, however it\'s not working as it say\'s that \"callback is not a function\".
Example:
C
showGradesBox
is a string in your code. So you have two options to execute the callback function:
If you want to keep the string you can use
this[callback](response);
(if callback
is defined in global scope you can also use window[callback](response);
Or you can pass the function directly:
var callback = showGradesBox;
(in this case you can keep your existing code for callback execution)