detect if javascript function exist
by khairil on