I'm not sure I follow you.

Is "handleTabSelect_Pers" the name of a function, and you've stored that
function name in the tabSelectHandler variable, and so you want the select
callback to call your handleTabSelect_Pers() function?

If that's correct, and handleTabSelect_Pers() is a global function, you
could use:

    var tabSelectHandler = "handleTabSelect_Pers";
    $('#tabs').tabs({
        selected: '0',
        fx: { opacity: 'toggle' },
        select: window[tabSelectHandler]
    });

If it's not a global function, but the function name is defined in the
current scope, you should be able to do it this way:

    var tabSelectHandler = "handleTabSelect_Pers";
    $('#tabs').tabs({
        selected: '0',
        fx: { opacity: 'toggle' },
        select: eval(tabSelectHandler)
    });

In fact that would work for a global function as well - I just prefer the
first version in that case.

-Mike

> -----Original Message-----
> From: jquery-en@googlegroups.com 
> [mailto:jquery...@googlegroups.com] On Behalf Of expresso
> Sent: Monday, April 06, 2009 11:35 AM
> To: jQuery (English)
> Subject: [jQuery] Sending js variables to a jQuery constructor
> 
> 
> Is this possible?
> 
> var tabSelectHandler = "handleTabSelect_Pers";
>           $('#tabs').tabs({ selected: '0', fx: { opacity: 'toggle' },
> select: tabSelectHandler });
> 
> where I'm passing tabSelectHandler variable into the tabs constructor?
> 

Reply via email to