Wednesday 17th January 2007
Simple but annoying me.
Why, when you tell the browser to wait for a response from the server, do you not include parentheses on the function name?
i.e:
request.onreadystatechange = updatePage;
Why isn't it:
request.onreadystatechange = updatePage();
??
Cheers.
Wednesday 17th January 2007
I don't know the answer in the context your talking about but I suspect that you're passing a reference to the method that will be called when the event occurs rather than passing the return value from the method IYSWIM.
Wednesday 17th January 2007
In simple language, you are simply stating that the reference for a is equal to the reference for b, thus making a and b one and the same.
If you included brackets, you would be saying that a is equal to the return value of b.
...if you see what I mean.
Thursday 18th January 2007
Thanks for the replies, makes sense.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff