반응형
다른 함수 내에서 함수를 어떻게 호출합니까?
다른 함수 내에서 자바 스크립트 함수를 호출하는 방법을 알고 싶습니다. 그래서 아래 코드가 있다면 첫 번째 함수 안에서 두 번째 함수를 어떻게 호출합니까?
function function_one()
{
alert("The function called 'function_one' has been called.")
//Here I would like to call function_two.
}
function function_two()
{
alert("The function called 'function_two' has been called.")
}
function function_one() {
function_two(); // considering the next alert, I figured you wanted to call function_two first
alert("The function called 'function_one' has been called.");
}
function function_two() {
alert("The function called 'function_two' has been called.");
}
function_one();
function function_one() {
function_two();
}
function function_two() {
//enter code here
}
function function_one()
{
alert("The function called 'function_one' has been called.")
//Here u would like to call function_two.
function_two();
}
function function_two()
{
alert("The function called 'function_two' has been called.")
}
참고 URL : https://stackoverflow.com/questions/4524877/how-do-i-call-a-function-inside-of-another-function
반응형
'program story' 카테고리의 다른 글
요소의 상단 위치를 얻는 방법은 무엇입니까? (0) | 2020.12.04 |
---|---|
printf를 사용하여 널이 아닌 문자열을 어떻게 인쇄합니까? (0) | 2020.12.04 |
Content-Language 및 Accept-Language는 무엇입니까? (0) | 2020.12.04 |
현재 지점, 거리 및 방위각에 따라 위도 / 경도를 가져옵니다. (0) | 2020.12.04 |
Linux에서 주어진 프로세스에 대한 개방 FD 제한 확인 (0) | 2020.12.03 |