Is there a way to call a server-side function from client-side script in a library?

Using many methods documented throughout several blogs, I have been able to successfully incorporate calls to SSJS functions via client side script in an xPage.

John Mackey outlines several methods here: http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-7GLFZG

However, I would like to migrate the client side script into a script library, and include that library in a normal HTML (outside of Domino) page.

The scenario is that we have a flat HTML web site.

I am embedding a Domino (xPage) “shopping cart” facility into one of the web pages via an iframe.

When the user adds an item to the cart, the logic modifies a sessionScope variable.

In the top section of every HTML page (not the xPage), there is an area which indicates the cart status (no. of items ordered and total value).

I would like to be able to call a script function which returns the value held by the sessionScope variable.

I can easily get this working in the contents of an xPage, but I would like to be able to call a function from a client side script library which returns that value (that way, I can simply include the library in each of the relevant HTML pages).

Can this be done at all, or am I barking up the wrong tree? If not possible, can anyone suggest an alternative method with which I can store the cart information so that it is available via client side script (i.e. cookies?)?

Any information that you could provide would be most appreciated!

T.

Subject: Solution

Thanks very much to Stephan Wissel for responding to my query in another forum.

Stephan maintains an excellent blog covering a wide variety of (sometimes very technical) subjects. Recently, he wrote an article that addresses my requirements exactly:

http://www.wissel.net/blog/d6plinks/SHWL-7MGFBN

Thanks again Stephan!!