问题描述
这是一个新手问题。我有两个JavaScript和一个HTML文件。当我点击图像时,它会转到第一个.js文件,当它运行时,所有代码都应该转到第二个.js文件。但是,如何连接不同文件中的两个函数。
谢谢
函数所处的文件无关紧要,您可以从第一个函数调用第二个函数。
您还应该考虑为什么要将您的功能分离为单独的文件 - 一般来说,它们应该尽可能少的文件。
This is a newbie question. I have two javascript and one html files. When I click on an image it goes to the first .js file and when it finnish to run all that code should go to the second .js file. But how can I connect the two functions that are in different files.
thanks
It doesn't matter what files the functions are in, you can call the second function from the first one.
You should also consider why you are separateing your functions into seperate files - in general, they should all be in as few files as possible.
这篇关于新手问题:连接两个函数int两个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!