jQuery - supplying context to handler lookup table in jquery

This is just one way you can do this with the this placeholder :

linksHandler = {
	"moreSearchOptions":function(){
		alert (this);
	}
}
 
$(function(){
 
	$('.linked').click(function(){linksHandler[this.id].apply(this); return false})
}
 
Reply:
 
 
 
 
rendered @ Thu May 23 9:04:13 CEST 2013