Jorge Godoy wrote:
Interesting, Michele, because I haven't tried putting it in master.kid. Since
it is something particular to this page only, I didn't think about putting it
there and polluting the whole site. This is definitely something to look
at. Specially because if I had something
Michele Cella [EMAIL PROTECTED] writes:
In my case adding it to the template that extends master.kid does
nothing, I always get:
body
I have the same problem here.
That's not what I would expect, I haven't looked too close at
master.kid but It can be a problem related to it.
Mine says:
Jorge Godoy wrote:
How can I call a javascript funcion on page load when a given python variable
is set? I tried:
body py:if=not variable
body py:if=variable onload=js_function(this.form['some_widget'])
...
/body
I would probably address this like so:
script py:if=variable
I looked up py:attrs to see if it is possible to do it the way you
want, but it doesn't look like the py:if works for attributes inside
elements. I would just change the variable from Boolean to the onload
method:
body onload=${jsonload}
You could also have it perform the js task right before
Jeff Watkins [EMAIL PROTECTED] writes:
I would probably address this like so:
script py:if=variable type=text/javascript language=javascript
function documentLoaded()
{
js_function(this.form['some_widget']);
}
if (window.addEventListener)
window.addEventListener( load,
script py:if=True
my_fun_method();
/script
/body
Though that somewhat defeats the purpose of onload.
I want to run a JS function, not a Python function... This is part of the
problem (the other part is that I don't know much JavaScript ;-)).
This is javascript. Let me redo it
Jorge Godoy wrote:
It didn't work also... I think the problem is that I'm not inside a form to
use this.form... I'll play a bit with your code, Jeff, and I'll see what I
can do.
Well, I can't guarantee the quality of other people's code. I just
copied this.form (etc) from your original
On Dec 6, 2005, at 12:48 PM, Jeff Watkins wrote:
Jorge Godoy wrote:
How can I call a javascript funcion on page load when a given
python variable
is set? I tried:
body py:if=not variable
body py:if=variable onload=js_function(this.form
['some_widget'])
...
/body
I would probably
Jared Kuolt [EMAIL PROTECTED] writes:
script py:if=True
my_fun_method();
/script
/body
Though that somewhat defeats the purpose of onload.
I want to run a JS function, not a Python function... This is part of the
problem (the other part is that I don't know much
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;
On Dec 6, 2005, at 1:19 PM, Jeff Watkins wrote:
Bob Ippolito wrote:
In these kinds of situations I prefer *never* to dynamically
generate code. What I do instead is simply place a hidden input
element in the page conditionally with whatever value is
necessary, and the JavaScript code
Hi Jorge,
If I've got right what you are trying to do, I think you can do
something like this:
on your master.kid
body py:match=item.tag=='{http://www.w3.org/1999/xhtml}body'
py:attrs=func
If you put it inside the template that extends master.kid it wouldn't
work, that's something to look at
12 matches
Mail list logo