Bob Ippolito <[EMAIL PROTECTED]> writes:
> <input type="hidden" value="${message}" id="show_message"
> py:if="show_message" />
>
> and the (probably external to the page) script would look something like:
>
> addLoadEvent(function () {
> var msg = getElement("show_message");
> if (!msg) return;
> alert(msg.value);
> });
It works! :-) And I'm using MochiKit already, so I prefer going with this
more simple and readable version.
> Of course, if the data you need to pass into JavaScript isn't just a string,
> you should probably JSON encode it.
It is just a boolean test, and I tested both true and false conditions and it
worked perfectly.
> There are a couple reasons for using methods like this:
>
> - It's hard enough to debug *static* JavaScript code
> - You can test the JavaScript code independently from any server stuff just
> by putting a test value in there and using py:attrs for the dynamic value
> - It's easy to do something with the data outside JavaScript using only XML
> machinery (XSLT even).
I'll keep that in mind!
Thanks!
--
Jorge Godoy <[EMAIL PROTECTED]>