On Mon, 16 Oct 2006, Michael Geary wrote:

> The return value from $() isn't a function and doesn't have a call method.
>
> In any case, Blair's code is the way to do it:
>
> $("#div")[call]();

Right - I should have been more clear. To use call/apply, you'd have to do 
it like this:

var obj = $('#div');
var meth = 'hide';

obj[meth].call(obj, 'slow');

var args = ['slow'];

obj[meth].apply(obj, args);

This probably isn't useful for the original poster's question, but it's 
good to know in many cases when you're trying to resolve method calls 
dynamically.

Dave

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to