I just want to know how to call a javascript function inside another function. so if I have the code below, how do I call the second function inside the first?

我只想知道如何在另一个函数中调用javascript函数。所以,如果我有下面的代码,我如何调用第一个函数?

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.")
}

3 个解决方案

#1


83

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();

更多相关文章

  1. 如何使函数等到对象的值未定义为js setTimeout
  2. 放在和中的javascript语句,但是语句不在函数中,这些语句何在被执行
  3. res.jwt不是函数 - NodeJS Express
  4. Javascript中的素数函数...多个语句
  5. touchableopacity onpress函数undefined(不是函数)React Native
  6. 运行一次后停止执行函数
  7. Javascript日期/时间函数是否依赖于客户端机器?
  8. 是否可以从节点js中的同一模块导出构造函数和一些正常函数?
  9. javaES6箭头函数的全新特性

随机推荐

  1. Android Developers 系列 01 - Introduct
  2. 重新解压打包android 根文件系统 ramdisk
  3. Android app 升级:android:versionCode和a
  4. 怎样搭建Android开发平台
  5. Windows下Camtasia Studio的安装与卸载
  6. android 开发技巧(5)--使 用 TextSwitche
  7. 【Android小经验】android:gravity和andr
  8. Android中webView与h5交互
  9. Android和Linux关系
  10. Android CTS 兼容性测试