I am using a trigger call a get a value from custom event but I want it to return a value and its only giving me Object Object when I do the following call:
var
Try this:
$("#my_div").on("get_id", function(e, username){ var user_id; if (username='fred'){ user_id=1; } else if(username='mario'){ user_id=2; } return user_id; }); var user_id=$("#my_div").triggerHandler("get_id", ["username"]);