I want to pass response object which i got from ajax call success, as an argument to an onclick function
That question was closed due to abuse reports, but apparently it can be answered.
The question "how to" is incorrect here, here is why: you cannot pass anything to this event handler, because you don't decide what to pass to it. The event is invoked by the browser on user's click; you never call your event handler and cannot decide what to pass to it and what not.
The other answer you got was not only completely wrong, but also impractical: the object passed through outer context, which can be done sometimes, but it not needed (see below) and is a bad coding practice.
However, you can get access to the DOM object clicked. The event object is always passed as the first argument to your event handler.
function myClickHandler(event) {
var domElement = event.target;
}
Please see:
https://developer.mozilla.org/en-US/docs/Web/API/Event.
This is the way to use the same event handler on more than one DOM element.
—SA