Verwenden Sie beim Laden des Fensters TypoF, um festzustellen, ob die Funktion im Kontext vorliegt
<script type = "text/javaScript"> window.onload = function () {try {if (test && typeof (test) == "Funktion") {test (); }} catch (e) {alert ("Die Methode existiert nicht"); }} function test () {alert ("Ich bin die test () -Methode"); } </script>