//判断父页是否存在某个javascript函数 function fnExist(fnName) { //return fnName in this && eval(fnName) instanceof Function; return fnName in this && typeof (eval(fnName)) == "function"; }
返回结果为 true false
//重载thickbox方法,实现刷新页面 function tb_remove() { if(fnExist("selectDepartment") == true) { selectDepartment(); } }