to put it another way, consider this example:
var twoPlusTwo = function(){
return 2 + 2;
};
window.addEvent('domready', twoPlusTwo); //adds a function that, on
domready, adds 2 and 2
window.addEvent('domready', twoPlusTwo()); //attempts to add the RESULT of
that function to domready, which is the number 4
The second example runs your function immediately, while the former passes a
reference to a function in memory to execute when the event is fired.
On Sun, Dec 27, 2009 at 5:03 PM, Sanford Whiteman <
[email protected]> wrote:
> > I want to add the showTeamGames function to the element
> > "curGameUpdtLnk" as an onClick event.
>
> 'showTeamGames' = function
>
> 'showTeamGames()' = *runs* showTeamGames (and may also return a valid
> function)
>
> You want the first one.
>
> -- Sandy
>
>