python, javascript and mysql

S

someguy

Hi all!
I'm new to python so i'm hoping someone could help me out. I'm
trying to use python for cgi. I have a page with pictures along the sides
and a table in the middle. The pictures on the side change using
javascript. What I want to do is populate that table by getting the
records from mySql using python and then somehow populate my table on the
page with these values. How do i pass these values from python back to
javascript? Or do i have to generate the whole html code again in the cgi
file?

Thanks in advance
 
L

Larry Bates

The answer is that you can do it either way.
You can have python create JavaScript that creates
a variable (normally an array) that contains the
values and then have a JavaScript function that
builds the table via DOM or you can just create
the entire page using Python (as HTML) on the
server and send it. All depends on exactly how
the application needs to act and if you are
comfortable with JavaScript client programming.

Larry Bates
Syscon, Inc.
 
S

someguy

Also, if you output the table as HTML and give an element an 'id' or
'name attribute, then you can find that elemente in javascript and
examine its contents. Take a look at
<http://devedge.netscape.com//toolbox/sidebars/2001/dom2/core.xml> for
all the nifty things javascript can do with an HTML document. Also,
devedge.netscape.com has much other interesting javascript on it.


Thanks for all your help guys....i'm looking into iFRAME and hopefully
that will solve my problem :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top