> the DIV is rendered fine in my tests, no need to add any prefix such
> as '.html' or '.load' for it to work.
hmm ok, i have to try some more, maybe i can find out how to reproduce
this strange behavior

>
> But having a LOAD in the controller generates an unnecessary ajax
> call,
this was just for demonstration purposes, but that failed :D

> and having the script action and view just makes web2py work
> harder instead of letting the web server do it from static, not to
> mention the clutter of having js all over your views directory.
I am working alot with js functions that init tab menus ...
When I write these i usually use things like {{=URL(foobar)}} in the
JS
With the example above  you can mix the web2py template language with
pure JS. This is nicer for me since vim highlits, indents, ... pure JS
much better than embedded JS. Also you can then pass args and vars to
your JS, and use URL() (which is better if you need routing)

Here is an example how i use it. This are the views of the annotate
controller
http://semanticsbml.svn.sourceforge.net/viewvc/semanticsbml/trunk/webui/views/annotate/
In the controller i just load the script.js once (index), all other
ajax loaded functions just use a JS init_foobar() function to activate
their buttons/fields with special functions
http://semanticsbml.svn.sourceforge.net/viewvc/semanticsbml/trunk/webui/controllers/annotate.py?revision=3325&view=markup
now i can apply this to a server and reroute all URL without having to
worry that i hard-coded them into the JS file

Reply via email to