Topic: Punbb functions in Javascript

If i wanted to put a function (say the "who's online?" function in a floating sidebar) WHAT would i need to put into the contents of the applet? Should it be a call for the function? The function itself? Neither?

Any help would be great. Thanks.