The question has already been confirmed by Felix. Inspired by his answer and the problem that I am experiencing in the current project, I wrote a small entity in which there is a class that adds a bit of extra security.
To summarize, you pass the callback function in the same way you pass a variable. Then the receiver activates it as a function.
myCoolFunction: function( data ) {
In the above $.get callback is myCoolFunction with the data parameter after receiving the data
What happens if myCoolFunciton is a variable. Well, it depends on how the receiver handles the input.
To be careful, I have a CoffeeScript class (and its JavaScript compilation) that will perform some security checks.
It does nothing magic, checks to see if its function is and returns if it does not return an empty function to reduce the chance of a JS error. https://gist.github.com/ziyan-junaideen/8717925
source share