how to call call method from one js file to another?

Posted by Gow.Net under JavaScript on 7/12/2013 | Points: 10 | Views : 2047 | Status : [Member] | Replies : 1
HI

I have two js file (a.js,b.js)

 a.js

function abcMethod(a,b,c){
//some cod
}


how can i call that method(abcMethod) from a.js to b.js

gowthaman8870226416


Responses

Posted by: Ishan7 on: 1/11/2021 [Member] Starter | Points: 25

Up
1
Down
you need to refer both JS file to the .aspx page

<script language="javascript" type="text/javascript" src="JScript1.js">
</script>

<script language="javascript" type="text/javascript" src="JScript2.js">
</script>


JScript1.js
function ani1() {
alert("1");
ani2();
}


JScript2.js
function ani2() {
alert("2");
}


Reference: https://stackoverflow.com/a/3809882/11954917

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response