You can use closure:
var obj = $("#someobject"); obj.data({ "prp1": "x", "dosomething": (function(scope) { return function() { callthisfunction(scope);
Example
<h / "> Or if you just want to send a data object:
var obj = $("#someobject"); obj.data({ "prp1": "x", "dosomething": (function(scope) { return function() { callthisfunction(scope.data()); } })(obj) });
source share