It's basically a new global list, response.scripts, that is rendered
in the jQuery(document).ready function so you can inject javascript
from the controller.  Massimo mentioned that it may go against MVC
separation standards and wanted me to put it out here to get a few
opinions.  Sample usage:

def index():
    if not request.vars.name:
        response.scripts.append("$('#messages').text('Messages: Name
Missing').css('color','red');")
    else:
        response.scripts.append("$('#messages').text('Messages: Hello
" + request.vars.name + "');")
    return dict()

What do you think?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to