호출자 함수를 찾으려면 비표준 기능인 "function.caller"를 사용해야 합니다. 이전에는 "argument.caller" 속성이 고려되었지만 이제는 사용되지 않습니다.
예시
다음 함수를 실행하여 호출자 함수를 가져올 수 있습니다.
라이브 데모
<html>
<head>
<script type="text/javascript">
function Display() {
alert("caller is " + Display.caller);
}
</script>
</head>
<body>
<p>Click the following button:</p>
<form>
<input type = "button" onclick = "Display()" value="Get caller function">
</form>
</body>
</html>