El jueves, 9 de mayo de 2013 19:52:47 UTC-3, Jose escribió: > > Hello, > > The normal behavior is: The user presses the Test button, then <div > id="sql"></div> show "ABCD". (The code is shown below) > > In development mode running rocket, works well, but in production ajax > call is not executed. > > > Environment: > > Web2py 2.4.6 (Version 2.4.6-stable+timestamp.2013.05.08.16.52.12) > FreeBSD 9.1 > Nginx-1.4.0 > Uwsgi-1.4.9 > > uwsgi.conf: > > <uwsgi> > <socket>127.0.0.1:9001</socket> > <pythonpath>/home/web2py/</pythonpath> > <module>wsgihandler</module> > <processes>4</processes> > <buffer-size>8192</buffer-size> > </uwsgi> > > nginx.conf > ... > location ~ /myapp{ > uwsgi_pass 127.0.0.1:9001; > include uwsgi_params; > } > > ... > > > default.py: > > def index(): > return dict() > > > def bg_test(): > id = request.vars.id > return id > > > > > default/index.html: > > > > {{extend 'layout.html'}} > > <script type="text/javascript"> > > > function test(){ > $('#id').val('ABCD'); > ajax('bg_test', ['id'], 'sql'); > } > </script> > <form> > <input type="hidden" name="id" id="id" value="" /> > </form> > > > <button type="button" onclick="test()">Test</button> > > > <div id="sql"></div> > > > I think the problem is not web2py, I tested with version 1.99.4 and also > works bad. > > Something that can be changed or added in nginx.conf or uwsgi.conf? > Any idea? > > Best Regards > Jose >
I think the problem is the url of the call ajax('bg_test', ['id'], 'sql'); must be well: url = "{{=URL('default', 'bg_test')}}" ajax(url, ['id'], 'sql'); José -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.