Sending extra parameters to JavaScript Events
13Jul09
Let’s say you want to use something like :
$.GetJson(url,printResults,textStatus);
Well what if you need to send additional information to printResults() ? I’ve been coding C# to long. I vaguely remember events before delegates and I haven’t made a function pointer since freshmen year in college. I’m not actually sure if there is a way of sending extra parameters to an event like this, but my solution was just to use an anonymous function before hand.
So something like this:
$.getJSON(request, ajaxData,
function(data, textStatus) {
printResults(extraDataToSend, data, textStatus);
}
);
Filed under: Uncategorized | Leave a Comment
No Responses Yet to “Sending extra parameters to JavaScript Events”