[Zope] condional client-side code

Andy Heath a.k.heath@open.ac.uk
Mon, 13 Mar 2000 18:48:50 +0000


Ideas please - how to do this.

I'm using zope in frames and need some output to be
condionally there depending on what the window name
is.  The idea is  for client-side code to decide 
whether or not its displaying in a frame and output
a header if needed.

The only way I know to do this is with javascript

"if (window.name=="whatever")" etc.
on the client side.  What makes is messy
is having to hand-process the stuff that's on the
"then" part to put it in document.write() calls.

This is quite messy because there's quotes and all sorts in
it.  It would be nice to write

    document.write("<dtml-var whatever>")

but because of messy chars and returns and so in
in the "whatever" document it doesn't work.  Also,
its really desirable to be able to have "whatever"
in just one place and use it in different ways in
different documents.

My current thinking is - "is there some way I could
process the contents on "whatever" on the fly so that
it would work with document.write?

Any other ways to do what I want?

Andy 
-- 
-------------------------------------------------
Andy Heath                    a.k.heath@open.ac.uk
The Open University           +44 (0) 114 2885738