Hi Sandy and Aaron, Thanks for your replies and that explanation. I think now I understand what I was doing wrong. I have corrected the code and it is working fine.
Really appreciate your help Cheers Sudheer On Dec 27, 5:47 pm, Aaron Newton <[email protected]> wrote: > 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
