結果 : check if function exists before calling javascript