新手问题:连接两个函数int两个文件 [英] newbie question: connect two functions int two files

查看:113
本文介绍了新手问题:连接两个函数int两个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个新手问题。我有两个JavaScript和一个HTML文件。当我点击图像时,它会转到第一个.js文件,当它运行时,所有代码都应该转到第二个.js文件。但是,如何连接不同文件中的两个函数。

谢谢

解决方案

div>

函数所处的文件无关紧要,您可以从第一个函数调用第二个函数。



您还应该考虑为什么要将您的功能分离为单独的文件 - 一般来说,它们应该尽可能少的文件。


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两个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆