your proposal in IE
var s = "this is a string with function word"; isFunction(s) // true cool!!! now, re-consider that we all like reliable code and your code as is is the less reliable ever for its purpose in IE. I gonna probably create a post in WR 'cause where you think "small and simple is better" here we have to deal with big application that should never fail ( at least that's my job ) so a bit more code to be as sure as possible is not an option for me. Regards On Mon, Aug 3, 2009 at 4:03 PM, DBJDBJ <dbj...@gmail.com> wrote: > > > I think we all know that In IE, typeof window.alert , returns “object” > Here is my portable isFunction() , IMHO it might be ine of the > simplest solutions that I have seen? > > > // GPL (c) 2009 by DBJ.ORG > var isFunction = typeof (top.alert) == "object" ? > function(x) { > return (x + "").match(/function/) !== null ; > } > : > function (x) { > return x instanceof Function; > } > > // test > isFunction( window.alert ) > // returns true, in all browsers > > Enjoy … > > --DBJ > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---