[off-topic]

A note about JavaScript, something that I learned on JS workshop last week.

in JS "window" is the same as globals() in python, so we do not need to use
that explicitly, int the same way we do in Python.

Ex:
Python.

*globals()["__name__"]* is the same of simply *__name__*

JavaScript

*window.location* is the same as simply *location*

So even your own objects are stored into window object (the same way your
python objects are stored in globals())

name ="Bruno" the same as window.name = "Bruno"

Not that gain of performance or something like, just curiosity.



On Wed, Mar 28, 2012 at 10:36 AM, Anthony <abasta...@gmail.com> wrote:

> I don't understand why HTTP(200,Location=URL(...)) isn't redirecting to
>> URL(...)?
>
>
> You need to issue a 303 to get the browser to redirect to the URL in the
> "Location" header. But if it is an ajax request, that will only redirect
> the ajax request itself -- it won't reload the whole page. If you want an
> ajax call to result in the whole page reloading, you'll have to do that via
> Javascript at the completion of the ajax call. If you are using the ajax()
> function to make the ajax call, you could do something like this:
>
> In the view:
>
> ajax("{{=URL('default', 'myfunc')}}", [], ":eval")
>
> In default.py:
>
> def myfunc():
>     return 'window.location = "%s";' % URL('default', 'otherfunc')
>
> Anthony
>
>


-- 

Bruno Rocha
[http://rochacbruno.com.br]

Reply via email to