On Thu, Feb 16, 2012 at 6:00 AM, lkcl luke <[email protected]> wrote:

> On Thu, Feb 16, 2012 at 8:17 AM, Jesse Vander Does
> <[email protected]> wrote:
> >
> > On Wed, Feb 15, 2012 at 10:56 AM, lkcl luke <[email protected]>
> wrote:
> >>
> >> On Wed, Feb 15, 2012 at 8:26 AM, Jesse Vander Does
> >> <[email protected]> wrote:
> >> > I have a div element that I would like to redirect to another url on
> my
> >> > site.  When I take that url routing offline I can see the proper url
> >> > show up
> >> > in the browser.  For example I can go from my.site.com to
> >> > my.site.com/login/google.
> >> >
> >> > However, as soon as I turn that url live instead of going to the url I
> >> > get
> >> > sent to this url:
> >> >
> >> > my.site.com/Index.safari.cache.html
> >> >
> >> > Contents:
> >> > This script is part of module Index
> >> >
> >> > I'm am calling Window.setLocation with a relative url so it looks like
> >> > this:
> >> >
> >> > Window.setLoaction("login/google")
> >> >
> >> > Thanks for any help you guys can offer.
> >>
> >>  jesse, please provide a full worked example *full* source code that
> >> allows people in under 30 seconds to run it and replicate the issue
> >> you're seeing.   it is unfair to ask people to spend 5-10 minutes
> >> writing an application which shows what the problem is.
> >>
> >>  also have you looked up the standard javascript HTML5 documentation
> >> on how to use window.setLocation?
> >>
> >>  l.
> >
> >
> >
> > Sorry, I'm having trouble building an example myself (For some reason
> > setting up a new pyjs project always seems to be the most painful part
> for
> > me).
>
>  i always start from cut/paste copying one of the examples so i
> absolutely never have this problem, period.  even after working with
> pyjamas for 3+ years i *never* "start" a new pyjs project from scratch
> - if for no other reason than it saves time on typing.
>
>  you might want to think about that, if even the lead developer
> *never* "sets up" a "new" pyjs project.


I do the same thing, that's why all of my projects are called hello world.
 Nonetheless, sometimes I still have issues.


> > I now have looked through the html5 api as well as have done more google
> > searching, reading through the pyjamas api and a few more experiments.  A
> > few notes for the record.
> >
> > The closest thing to Window.setLocation seems to be window.location or
> > possible window.location.href as location is an object in the javascript
> > api, but seems to be a string in the pyjs api.
>
>  yep.  that's it.  now look at the code in Window.py - do *not* treat
>
the pyjamas code-base as some sort of stupid "black box".

I never treat pyjs as stupid black box, as I mentioned above I always have
pyjs api, which links to the source, open.  Were you suggesting I dig into
the the compiler, never done that.   Anyways, I finally have a sense of
what is going on and want share what I've found in case other people find
it useful or my understanding can be improved or corrected.

The Window.setLocation was attempting to redirect the iframe.  I don't
fully understand the importance of the iframe to pyjs, but I do know that
it is.  My work around has been to call through to javascript with this
line of code:

        JS("""top.location.href = "service/login/"+provider """)

This sets the location for the top most browser window and gets my web app
working.

 it's
> essential that you understand the relationship between "DOM in python"
> and "DOM in javascript", and examining the codebase is going to get
> you part-way towards that.
>
>
> > Also, I now see that I can redirect to an external page, but not an
> internal
> > uri either with an absolute or relative value.
>
>  find one in javascript.




-- 
Jesse Vander Does
401-226-8251 | [email protected]

Reply via email to