Re: Executing JavaScript from AllegroServe

Robert Clark <[email protected]> Fri, 08 Aug 2003 16:12:14 -0600
Newsgroups gmane.lisp.open-source.franz
Message-ID <[email protected]>
Earl,

after re-reading your article (with a little push from a
co-worker), I think I get it. The "url" in:

document.write('<script src="', url, '"
type="text/javascript"></script>');
would be the url of a published Lisp function that would issue the
JavaScript calls. I haven't had a chance to try it, but I like
it!!

Thanks,

Bob

At 11:35 PM 8/6/2003 -0400, Earl Wagner wrote:

It sounds like you want to have the
button send an http request to the Lisp web server, which then returns
some Javascript code. You can then load the javascript into the window's
environment. See:

Dynamically Loading External JavaScript Files

http://www.codehouse.com/javascript/articles/external/

-Earl

On Wednesday, August 6, 2003, at 05:12 PM, Robert Clark wrote:

Say I have a web page that I've
served up with AllegroServe (AS), and the page has a button on it.
How do I click on the button and execute CL code which in turn executes
JavaScript codewithout serving up a new page?

Here's my real situation:

AS serves up a page with a JavaScript TreeView object in it, with
only the first level built (I don't want to build the whole tree - it's
too big!). When the user clicks to expand one of the folders, I
want to execute CL code which generates JavaScript code to generate the
new nodes. (effectively onmouseclick="foo(folderID)", where
foo() is a CL function, which generates JavaScript like
createNode(folder, node1); createNode(folder, node2); ...).

Bob Clark