I am creating a canvas on a webpage to display some graphics.
In order to create the graphics I need to grab the screen size of the device. To do this I am using a ajax call in the header of the view of the display_canvas function to pass the screen width to a helper function which redirects to the display_canvas function with the screen width added as an argument. I can see the redirect taking place and it returns html rendered by web2py helpers which includes the new width. However the new html code is not render by the browser. Any help would be great?? display_canvas.html {{extend 'layout.html'}} <head> <script> var param = screen.width $.getScript("{{=URL('default','display')}}"+"/"+param) </script> </head> <body> generated by html helpers and scaled by width parameter. </body> def display_canvas(): try: screen_width = request.args[0] except: screen_width = 0 return dict(screen_width=screen_width) def display(): try: screen_width = request.args[0] except: screen_width = 0 if screen_width > 0: redirect(URL('default', 'display_canvas', args=[screen_width])) return dict(screen_width=screen_width) -- 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.