try 
{
  你的function1
}
catch(e){ aler('不存在该函数!')}