Q:

Adding function parameters using a single variable in jQuery

I was thinking the is it possible to pass a variable to function which is to be executed on clicking the button and the function is given by a variable.
Also the parameters of the functions could be more than one and so I separated them by ,.
So is there a way that I can put the parameters into function using any jQuery plugin or a function. Please help me out, cause I'm confuse big time! Here is my current jQuery Code:
function Func (a,b){
 alert(a+' | '+b);   
}
var Parameters = 'cool,123';
var Function = Func;

$('button').click(Function);

Problem demo
Thanks in advance

A:

You can use function.apply(). Pass your list of parameters in as an array and you can even set a scope if you wish to do so:
function myFunc(a,b){
    alert(a+", "+b);
}

var args = ["one", "two"];
var func = myFunc;

$('button').click(function(){
    func.apply(this, args);
});

A:

Is this what you're after?
function Func (a,b){
 alert(a+' | '+b);   
}
var Parameters = 'cool,123';

$('button').click(function() {
    Func.apply(this, Parameters.split(","));
});

Demo: http://jsfiddle.net/6nJx7/14/
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/function/apply

