including JavaScript array in Lisp web page with HTMLgen and Allegro Serve
markandeya <[email protected]> Wed, 28 Sep 2005 16:19:16 +0530
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Message-ID | <[email protected]> |
Dear Lispers,
Help!!!
RE: Web app with Alegro Serve, Publish a page including a Java Script
array.
I get a return list from a mysql select query. I want to send that
info to the web page
in such a way that it can be manipulated in the browser. I want
to create an array
in Java Script to hold the data and then i can call the array from
events in the browser itself.
1) How to include java script in an html page with HTMLgen and
allegro serve??
2) how to pass the list or an array into the java script array?
Here is some code for a Java Script Array creation in a
normal html page:
<html>
<h2>Creating and Accessing arrays</h2>
<script language="Java Script">
<!-- Hide
numArray = new array(45,67,34);
document.write("[0]=",numarray[0],"<br>");
document.write("[1]=",numarray[1],"<br>");
document.write("[2]=",numarray[2],"<br>");
//End Hide-->
</script>
</html>
how to put into the lisp code the hide and end hide, and how to
include those semi-colons without emacs or other editors getting mixed
up?
here is some basic code from Allegro's HTMLgen help:
(defun simple-table-c (count)
(with-open-file (p "test.html"
:direction :output
:if-exists :supersede)
(html-stream p
(:html
(:head (:title "Test Table"))
(:body
((:table border 2)
(dotimes (i count)
(html (:tr (:td (:princ i))
(:td (:princ (* i i))))))))))))
I have elegant code to take the Mysql list and put it into a
lisp array but need to create, fill and pass a Java Script array.
Thanks for your time and consideration, it is not only a
tremendous help but a saving Grace for me. Peace and joy, Markandeya
ps. Incase anyone wants to know why i want to pass an array, it
is to display parent records in a table and when one clicks on a table
row in the browser the child row details are displayed in text boxes.