简体   繁体   English

如何在另一个Javascript中调用已定义的函数

[英]How do I call a defined function in another Javascript

Here is the code in languageSwitcher.js 这是languageSwitcher.js中的代码

$('#selectlanguage').change(AnyFunctionfromAnotherJsFile);

I do not want to make AnyFunctionfromAnotherJsFile as global function. 我不想使AnyFunctionfromAnotherJsFile作为全局函数。

This waits for on change and runs a function that calls setButtonText(); 这等待更改,并运行一个调用setButtonText()的函数;

$('#selectlanguage').change(function(){
   setButtonText();
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在另一个Javascript函数之外调用Javascript函数? - How do I call a Javascript function outside of another Javascript function? 如何调用javascript变量中定义的函数 - How do I call a function defined in a javascript variable 如何在同一个javascript命名空间中调用另一个函数? - How do I call another function in the same javascript namespace? 如何使用 Vue 从另一个计算的 function 中定义的 JavaScript 调用计算的 function? - How can I call computed function from JavaScript defined in another computed function with Vue? 如何将 javascript 中定义的一个函数调用到另一个 javascript 文件? - How to call one function defined in a javascript to another javascript file? 如何使用另一个JavaScript文件中定义的类名调用回调函数 - How to call the callback function with class name defined in another javascript file 如何将已经定义的javascript函数传递给jquery调用? - How do I pass a javascript function I've already defined into a jquery call? 如何调用HTML中另一个文件中定义的javascript函数? - How to call javascript function defined in another file from HTML? 我如何在另一个函数上调用一个函数 - How do i call a function on another function 如何显示(或调用)在javascript中的数组内部定义的匿名函数的内容 - how do I display(or call) the contents of an anonymous function that is defined inside of an array in javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM