> > $("#div").call()
> >
> > tries to call the "call" method on $, but since there is no "call" 
> > method (that I know of), it's not working.
> 
> Actually, there is:
>
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Ob
jects:Function:call
> 
> Using call or apply is another approach to solving this type 
> of problem, but you have to be careful to pass in the 
> appropriate "thisArg", which in this case would be the jQuery 
> object itself.

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]();

You can test this by going to www.visualjquery.com and paste this into the
FireBug console command line (click after the >>>):

var call = 'hide'; $('div')[call]();

:-)

-Mike


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

Reply via email to