Hi,
I'm relatively new to JS, but I have some experience with ActionScript. Can anybody explain this to me:
I define a function:
Code:
function myFunction () {something.....;}
And then I want to call it by a event handler:
Code:
document.onmousemove = myFunction();
it doesn't work. Why?
I know, that the correct syntax would be:
Code:
document.onmousemove = myFunction;
WITHOUT ANY PARAMETERS. Why is this correct?
And how is it possible to pass any parameters to my function (if it was pe.: myFunction(someParameter) {blabla.....;}
Thanks for explanation.
Bye, Kozelnik