Pretty simple question, I think, here's what I'm doing:
function buttonOnClick()
{
var relevant_context = 'important data';
$.get('/test', relevant_context, callback);
}
function callback(data)
{
alert(this.data); // always null, expected to be 'important data'
}
I expect this.data to be the contents of "relevant_context", or what I sent in the 2nd parameter of my $.get call, but it's always null. Is there some way (besides a global variable and besides returning extra data from the server) to pass some context to the callback function?