[Zope] Making javascript with ZPT variables
Peter Sabaini
peter at sabaini.at
Fri Nov 7 09:06:32 EST 2003
Hm I think IE and Konq might be missing the ';'s after the variable
definition in the first script
Anyway this looks like a client issue; browsers really *should* see the
vars from the first script
hth peter.
Lennart Regebro wrote:
> I'm sure this is FAQ, but I can't really find anything conclusive.
>
> I have a ZPT page, in which I have quite a bit of javascript, in which I
> need ZPT variables. So far I have done this:
>
> <script language="JavaScript" type="text/javascript"
> tal:content='structure string:
> var thisurl = "${here/absolute_url}"
> var search_fields = ${data/js_search_fields}
> var role = "${data/role}"
> var method = "${data/method}"
> '>
> </script>
>
> <script language="JavaScript" type="text/javascript"
> tal:content="structure python: here.pylist2js('owners', owners)">
> </script>
>
> <script language="JavaScript" type="text/javascript">
>
> here is the actual javascript code....
>
> </script>
>
>
> Now this doesn't work in IE, (or Konqueror) and that is because the
> variables defined in the first piece of javascript is not propagated to
> the later javascripts. It works fine in Mozilla, by the way.
>
> So, I need to define one BUG javascript, that not only defines the
> codes, but also the variables. The problem here is mainly ho I can get
> the code, which is text, together with the lists, that need python code
> for the conversion.
>
> How do you people to it?
>
> //Lennart
>
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3461 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.zope.org/pipermail/zope/attachments/20031107/5539c5ce/smime-0001.bin
More information about the Zope
mailing list