Well I declare a function in a javascript file
javascript file:
window.onload = function(){
function func(x,y){
//faz operacoes em x e y e nao retorna nada
}
}
But in the html file, when I want to call this function by passing the parameters x and y
html file:
<script type="text/javascript">
func(2,3);
</script>
It's the error in the html file saying that the function is undefined, I already tried to do something like
<script type="text/javascript">
window.onload = function() {
func(2,3);
}
</script>
I'm not sure what to do, but I do not know what to do with it,
Note: I'm using global variables, besides the fact that my algorithm is too large to put into html, so if you can tell me a way to pass the parameters of a javascript function in html would help me a lot