open frame in new window

Discussion in 'Javascript' started by jasiu86, Sep 11, 2009.

  1. jasiu86

    jasiu86 Guest

    welcome,

    I have this problem:
    I open a new window in the frame that redirects the user to the page
    with Gmail, and at the same time it logs on.

    gmail loads in the new window, but when I click Calendar or Documents
    in the upper left corner of the page, links open in parent window in
    tabs.

    I want to open in the same window (with Gmail) in the tabs.
    <code>
    function openNewWindow(el, name)
    {
    var wnd = window.open('', typeof name != 'undefined' ? name : '',
    'menubar=yes,toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,resizable=yes');

    var komunikat = "Proszê czekaæ, trwa ³adowanie...";
    var html = "<html><head>" + "</head><body>" + komunikat + "<iframe
    name='google' height='0' width='0' frameborder='0' src='" + el + "'/
    >";

    html += "</body></html>";

    wnd.parent = wnd;
    wnd.focus();
    wnd.document.open();

    wnd.document.write(html);

    wnd.document.close();

    return true;
    }
    </code>
     
    jasiu86, Sep 11, 2009
    #1
    1. Advertising

  2. jasiu86

    SAM Guest

    Le 9/11/09 12:30 PM, jasiu86 a écrit :
    > welcome,
    >
    > I have this problem:
    > I open a new window in the frame that redirects the user to the page
    > with Gmail, and at the same time it logs on.


    <iframe target="self" ...

    But ...

    > gmail loads in the new window, but when I click Calendar or Documents
    > in the upper left corner of the page, links open in parent window in
    > tabs.


    That is certainly a feature of gmail
    in JS if(self!=top) top.location=self.location;
    or in HTML <base target="_top">

    They do use something like here in JS,
    see one of the last script of gmail's page
    They do use quite exactly that JS code on mail.google.com/mail/blah...
    I'm surprise that you need to click on Calendar, gmail would have to be
    opened in the main window.

    What does that do when you open a "normal" page ?

    --
    sm
     
    SAM, Sep 11, 2009
    #2
    1. Advertising

  3. jasiu86

    jasiu86 Guest

    On 11 Wrz, 13:52, SAM <>
    wrote:
    > Le 9/11/09 12:30 PM, jasiu86 a écrit :
    >
    > > welcome,

    >
    > > I have this problem:
    > > I open a new window in the frame that redirects the user to the page
    > > with Gmail, and at the same time it logs on.

    >
    > <iframe target="self" ...
    >


    it doesn't work. perhaps because gmail redirect on self page. I guess.

    > But ...
    >
    > > gmail loads in the new window, but when I click Calendar or Documents
    > > in the upper left corner of the page, links open in parent window in
    > > tabs.

    >
    > That is certainly a feature of gmail
    > in JS if(self!=top) top.location=self.location;
    > or in HTML <base target="_top">
    >
    > They do use something like here in JS,
    > see one of the last script of gmail's page
    > They do use quite exactly that JS code on mail.google.com/mail/blah...

    I know about this ;]


    > I'm surprise that you need to click on Calendar, gmail would have to be
    > opened in the main window.


    but when I open Calendar normally (not wnd.open) in browser, Calendar
    open in new tab in the same window.
    I want the same result.

    >
    > What does that do when you open a "normal" page ?
    >

    The normal page open in iframe (without redirect).

    tg
     
    jasiu86, Sep 11, 2009
    #3
  4. jasiu86

    SAM Guest

    Le 9/11/09 4:55 PM, jasiu86 a écrit :
    > On 11 Wrz, 13:52, SAM <>
    > wrote:
    >> <iframe target="self" ...

    >
    > it doesn't work. perhaps because gmail redirect on self page. I guess.


    Not surprised.

    I think gmail "redirects" itself in mother (or grand mother) window.
    Calendar is another application than gmail so it's normal that it's been
    opened in a new window (in a tab if this option was chosen in the
    navigator).

    >> I'm surprise that you need to click on Calendar, gmail would have to be
    >> opened in the main window.


    I mean that normally gmail would have been redisplayed in the main
    window (without clicking somewhere).

    > but when I open Calendar normally (not wnd.open) in browser, Calendar
    > open in new tab in the same window.


    A "tab" *IS* a window.
    Are there tabs in you iframe ? No.
    So don't expect that Calendar called from gmail will open in same
    window. (except if Google offers this feature in some preference
    somewhere I didn't find).

    > I want the same result.


    Not possible.
    (in an iframe)

    Perhaps using frames ?
    with a lot of work I imagine.

    --
    sm
     
    SAM, Sep 11, 2009
    #4
  5. In comp.lang.javascript message <2674651d-5843-4479-b9ab-a29a3d80bc2c@z2
    4g2000yqb.googlegroups.com>, Fri, 11 Sep 2009 03:30:48, jasiu86
    <> posted:

    > var wnd = window.open('', typeof name != 'undefined' ? name : '',


    var wnd = window.open('', name || '', // ??

    typeof name == 'string' // ??

    It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

    --
    (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF3 Op9 Sf3
    news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
    <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
    <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
     
    Dr J R Stockton, Sep 11, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gordon
    Replies:
    3
    Views:
    340
    Steven Burn
    Apr 16, 2004
  2. lir
    Replies:
    0
    Views:
    155
  3. PC HUA
    Replies:
    2
    Views:
    466
    PC HUA
    May 19, 2004
  4. Danny
    Replies:
    1
    Views:
    149
    kaeli
    Jul 21, 2004
  5. Replies:
    1
    Views:
    272
Loading...

Share This Page