python, javascript and mysql

someguy inderjitrai at yahoo.com
Fri Sep 10 16:42:21 EDT 2004


Phil Frost <indigo at bitglue.com> wrote in
news:mailman.3141.1094823335.5135.python-list at python.org: 

> 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.
> 
> On Fri, Sep 10, 2004 at 08:13:24AM -0500, Larry Bates wrote:
>> 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.
>> 
>> "someguy" <inderjitrai at yahoo.com> wrote in message
>> news:Xns95601196933C1inderjitraiyahoocom at 66.185.95.104...
>> > 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


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



More information about the Python-list mailing list