Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > open frame in new window

Reply
Thread Tools

open frame in new window

 
 
jasiu86
Guest
Posts: n/a
 
      09-11-2009
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>
 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      09-11-2009
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
 
Reply With Quote
 
 
 
 
jasiu86
Guest
Posts: n/a
 
      09-11-2009
On 11 Wrz, 13:52, SAM <(E-Mail Removed)>
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

 
Reply With Quote
 
SAM
Guest
Posts: n/a
 
      09-11-2009
Le 9/11/09 4:55 PM, jasiu86 a écrit :
> On 11 Wrz, 13:52, SAM <(E-Mail Removed)>
> 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
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      09-11-2009
In comp.lang.javascript message <2674651d-5843-4479-b9ab-a29a3d80bc2c@z2
4g2000yqb.googlegroups.com>, Fri, 11 Sep 2009 03:30:48, jasiu86
<(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Window.Open get new tab instead of new window in FireFox Fredzidd@gmail.com Javascript 1 02-29-2008 03:06 AM
new window target different frame in original window Danny Javascript 1 07-21-2004 12:59 PM
window.open() doesn't open new Window in Opera PC HUA Javascript 2 05-19-2004 02:29 AM
Need to open a new browser window, not a new window Gordon ASP General 3 04-16-2004 10:46 PM
How do you make sure a frameset is loaded? I'm trying to open a frameset in a new window which shows a specific html page in a specific frame ck388 Javascript 1 09-24-2003 08:32 PM



Advertisments