[mod_python] Passing parameters to javascript from python script

Lee Brown administrator at leebrown.org
Tue Feb 22 19:39:41 EST 2005


Greetings!

Here's the 'brute force' way to pass data from the server to the user agent:

1 - Using mod-python, inject the following HTML somewhere within the body of
the document:

	<input id="unique_id" type="hidden" value="my_data" />

2 - In JavaScript:

	my_data = Document.GetElementByID('unique_id').value()

-----Original Message-----
From: mod_python-bounces at modpython.org
[mailto:mod_python-bounces at modpython.org] On Behalf Of rphelps
Sent: Tuesday, February 22, 2005 4:39 PM
To: mod_python at modpython.org
Subject: [mod_python] Passing parameters to javascript from python script

I have written an application that queries a Firebird database from a web
page using Apache and mod_python. After the query my python script generates
gif files using gri and imagemagick. I want to automatically display these
images to the user but don't know how to pass the files names to a
javascript that opens the new browser windows. May be there an easier way to
do this? 

RLP



More information about the Mod_python mailing list