If I pass the data object to a function as in:
$("#someobject").data({
"prp1":"x",
"dosomething":function(){
callthisfunction(this); //<---- HERE the data ref is sent to a function
}
});
...
function callthisfunction(in_data)
{
//how is the data element?
var theElementHoldingTheDataIs = in_data.????; //<--- how can I get $("#someobject")
}
My questions is: is there a way from data to inform to which object it depends on or belong to?
You can use a closure:
Example
Or if you just want to send the data object: