Yeah, you surely can. You just need to include both JS files in your ASPX pages as follows:
<script type="text/javascript" src="js1.js"></script>
<script type="text/javascript" src="js2.js"></script>
I added two scripts in my sample app which are as follows:
js1.js : Contains the following method
function js1() {
alert("Hello from js1");
js2();
}
And,
js2.js : Contains the following method
function js2() {
alert("Hello from js2"
);
}
Please note the
js1()
function of
js1.js
invokes the
js2()
function, which is written in
js2.js
.
And, I called the
js1()
method of
js1.js
in my
aspx
page as follows:
<script language="javascript">
js1();
</script>
It gave me alert messages from both JS files:
"Hello from js1"
"Hello from js2"