def data(): if auth.user_id==0: redirect("http://google.com") rows=0 if request.vars.q: db.chats.insert(shouter=auth.user and auth.user.first_name, msg=request.vars.q) size=len(db(db.chats.id>0).select()) lower=size-8 if size-8<=0: lower=0 rows=db(db.chats.id>0).select(limitby=(lower, size)) chatlist=[] for row in rows: shout="<div style='background-color:lightblue'> <p style='font-size: 1.4em'> %s : %s <br><span style='font-size: 0.5em'> %s </span></p></div><br>" % (str(row.shouter), str(row.msg), str(row.date_time)) chatlist.append(shout) return chatlist
in view: {{extend 'layout.html'}} <div style="width:50em; height:33em;border:2px black solid;overflow:auto"><div id='target'> </div> </div> <INPUT type="text" name="q" /> <INPUT type="button" value="submit" onclick="ajax('{{=URL('default','data')}}',['q'],'target');"/><br/> I want to redirect the whole page to some arbitrary website if ajax call finds that it is not logged in...how do I do that.. i dont want to do it in def index() function, i want to do it in function that ajax calls -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.