On 4 September 2010 07:54, Johan Arensman <[email protected]> wrote: > Feature checking is usually done by checking for a specific method or > attribute on the object. > For a template you can check for the evaluate method: > if(MyObject.evaluate) { > // it's a template > } > > On Wed, Sep 1, 2010 at 5:20 PM, Richard Quadling <[email protected]> > wrote: >> >> Hi. >> >> I can't find a way to determine the type of object being supplied to a >> function. >> >> I can check if it is a string ... >> >> if (Object.isString(param)) { >> var tmpl = new Template(param); >> } else if (Object.type(param) = 'Template') { >> var tmpl = param; >> } >> >> sort of thing.
I found instanceof also to work for me. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
