Do not use $.web2py, try jQuery.web2py instead. This is wrong:
response.js = '$.( "#graph1" ).append( "<p>Test</p>" );'
should be
response.js = '$( "#graph1" ).append( "<p>Test</p>" );'
or
response.js = 'jQuery( "#graph1" ).append( "<p>Test</p>" );'
On Monday, 30 June 2014 07:23:53 UTC-5, Richard wrote:
>
>
> Dear web2py colleague,
>
> I am struggling with the response.js in order to load a component.
>
> Loading a component through {{=LOAD....}} works fine.
> We want to load that component after accepting and processing a form. So i
> put a named div in the view and let response.js do the loading by the form
> processing.
>
> controller:
>
> def index():
> if form.process().accepted:
> response.js = '$.web2py.component("%s", target="graph1");' %
> URL('default', 'graph1.load')
>
> index.html:
>
> <div id="graph1" style="width: 400px; height: 400px; margin: 0 auto">
> </div>
>
> Besides this simplifying the case looks that my app does not listen to
> response.js because just adding the following line does not add the
> specified HTML tot the div with id location1:
>
> response.js = '$.( "#graph1" ).append( "<p>Test</p>" );'
>
>
> Sorry for being inpatient because this question is repeated from this tread
> https://groups.google.com/forum/#!topic/web2py/nbOpM-0_QvA
> but this is standard web2py.
>
> Thank you for the support.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.