js 判断某个方法是否存在
function fnExist(fnName) { return fnName in this && typeof (eval(fnName)) == "function"; }
?
转自:http://qitonghui.iteye.com/blog/1063460