[web2py] Re: ajax and redirect

2010-11-14 Thread leone
Thanks, i understand. On Nov 14, 6:24 pm, mdipierro wrote: > depends how you make the ajax callback. > > If you use LOAD() the redirect should work. > > If you use ajax(...,':eval') you can > > return "document.location='%s'" % URL(...) > > On Nov 14, 3:23 am, leone wrote: > > > > > > > > >

[web2py] Re: ajax and redirect

2010-11-14 Thread mdipierro
depends how you make the ajax callback. If you use LOAD() the redirect should work. If you use ajax(...,':eval') you can return "document.location='%s'" % URL(...) On Nov 14, 3:23 am, leone wrote: > Hi all, > how can I use redirect() inside a ajax callback? > Thanks in advance > leone

Re: [web2py] Re: ajax and redirect

2010-11-14 Thread Jonathan Lundell
On Nov 14, 2010, at 8:31 AM, leone wrote: > > Right, i must be more specific. > I have javascript code that call back (by ajax) a controller function > in which i compute variables sent from ajax and i redirect forward a > new address with args. > Python code is simple but doesn't redirect using r

[web2py] Re: ajax and redirect

2010-11-14 Thread leone
Right, i must be more specific. I have javascript code that call back (by ajax) a controller function in which i compute variables sent from ajax and i redirect forward a new address with args. Python code is simple but doesn't redirect using redirect(URL(...)). Is it possible redirect from python

[web2py] Re: ajax and redirect

2010-11-14 Thread qqsaqq
I assume you mean a redirect from within the browser, after recieving the ajax response and evaluating the retrieved data. In that case you must set the window.location object in your javascript. In the view you could do smthg like that: //... your callback code here window.location.href = {{=URL