[ZPT] tal replacements in javascript

Thomas Olsen thomas@iconmedialab.dk
Thu, 17 May 2001 20:06:58 +0200


Hi

Sorry for all the newbie questions - heres another one.

I have a gif image which gets changed using javascript depending on a
status that I read from a python script. In the container object I have
a property which shows part of the path to the image and I get the rest
of the name from the python script "chatstatus".

The property should give something like: ../img/image_status_

and the python can return "busy", "available" and "unavailable".

>From this I want to construct the filenames:
	../img/image_status_available.gif
	../img/image_status_unavailable.gif
	../img/image_status_busy.gif

but the replacement never takes place? Heres a snippet from the rendered
source:

<script type="text/javascript" language="Javascript">
    if(top.topFrame.document.images.status_light) {
        top.topFrame.document.images.status_light.src = '<dummy
tal:replace="here/image_status_subpath" /><dummy
tal:replace="here/chatstatus" />.gif';
    }
</script>


BTW: is there no way of joining conditions as in <p
tal:condition="(exists) /path/subpath; (exists) /path/othersubpath" /> ?

-- 
Thomas Olsen
Programmer
Icon Medialab, Denmark
Havnegade 39, 3-5 sal.
DK-1058 Copenhagen K

Icon Office  :  +45 70 23 10 01
Icon Fax     :  +45 33 32 02 09
Email        :  thomas@iconmedialab.dk,tanghus@kde.org

http://www.iconmedialab.com - http://www.tanghus.dk

Do not meddle in the affairs of programmers, for they are easy to annoy,
and have all the source code!!!