Good question.
I like the idea as it gives us a nice place to put scripts and make them
apply to the views we want very easily. so +1 on that!
Regards,
Jason Brower
On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote:
> 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
-~----------~----~----~----~------~----~------~--~---