Ok, here's a simple code sample that demonstrates how to load jQuery and use it in a server callback.
The key to understanding what is happening with this, is to understand when the jaxer server instantiates a DOM.
Let's review, the flow from disk to browser is roughly this.
NOTE.
DOM(1) exists on the server during the page processing and is then discarded.So this means that when we do a callback, we have to ensure that the environment is setup the way that we want it. To do this we have the special 'oncallback()' function that can be defined on a page.
One of the things you'll have to do here, is to load the jQuery lib (or whichever external lib/code you want) using the Jaxer.load method.
Now another difference during a callback is that the global object is not the window object (we will be fixing this, but for now...) so we have to pull the jQuery object from the window object and make it a global value.
So when you run this code you should see something like the following in the log
16:11:52 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] http://localhost:8081/test.html 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] Setting up environment for the callback 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] loaded jQuery 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] first: OK I'm in the callback... 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] first: ...callback completed 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] Setting up environment for the callback 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] jQuery already loaded. 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] second: OK I'm in the callback... 16:11:53 01/28/2008 [ 5332] [INFO] [JS Framework] [framework.] second: ...callback completed