By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,380 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,380 IT Pros & Developers. It's quick & easy.

Show Subwindow

P: n/a
Hi All,

I have got two windows namely parent and a child .

My parent window has got a link, on clicking which opens a child window(i am
using window.open function).

I do the following set of operations

In my parent window i click the link which results in popping up the child
window,
now i will minimize this child window and will click the link in parent
window again,
this time the child window will not popup(maximizes), it sits on the tray in
minimized
position.

Can anyone suggest me how to make child window show in maximized form when i
click
the link in parent window for the second time.

Here is the piece of code i am using for the same.

<a style='text-decoration:none'
href="javascript:showSubWindow1('ChildWindow.asp') ;">
Child Window </a>

<Script language = "JavaScript">

function showSubWindow1(url)
{
subwindow1 = true;
var subwindow = window.open(url,"def1",
"HEIGHT=650,WIDTH=770,SCROLLBARS=YES,RESIZABLE=YES ,status=yes");
}

</Script>

Thanks
Venkat
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
DU
Venkat wrote:
Hi All,

I have got two windows namely parent and a child .

My parent window has got a link, on clicking which opens a child window(i am
using window.open function).

I do the following set of operations

In my parent window i click the link which results in popping up the child
window,
now i will minimize this child window and will click the link in parent
window again,
this time the child window will not popup(maximizes), it sits on the tray in
minimized
position.

Can anyone suggest me how to make child window show in maximized form when i
click
the link in parent window for the second time.

I've answered this question, difficulty at least 20 times in the last 2
years in 3 different newsgroups.

Have a close look to the source code of these pages:

http://www10.brinkster.com/doctorunc...ra702Bugs.html

and

http://www10.brinkster.com/doctorunc...tSAndrews.html

Theory:
http://www10.brinkster.com/doctorunc...seLowerSetting

Your difficulty pinpoints an inherent flaw in the window.open() method
and in the windowing system of current operating systems like windows,
linux, etc.
Here is the piece of code i am using for the same.

<a style='text-decoration:none'
href="javascript:showSubWindow1('ChildWindow.asp') ;">
Child Window </a>

For **many reasons** that I won't explain here, do not use "javascript:"
pseudo-protocol in your href attribute value.

<a href="ChildWindow.asp" onclick="showSubWindow1(this.href); return
false;">Child Window </a>

7. Begin Link Names with the Most Important Keyword
"Links are the action items on a homepage, and when you start each link
with a relevant word, you make it easier for scanning eyes to
differentiate it from other links on the page."
http://www.useit.com/alertbox/20020512.html

So, "Child Window" is not best. "My resume", "My marriage", "My garden"
are good link editions though.
For the best recommendable coding, I recommend given examples you can
find at my homepage.

<Script language = "JavaScript">
type has superseded language and is both backward and forward compatible.

function showSubWindow1(url)
{
subwindow1 = true;
var subwindow = window.open(url,"def1",
"HEIGHT=650,WIDTH=770,SCROLLBARS=YES,RESIZABLE=YES ,status=yes");
}

</Script>
Your subwindow variable must be a global variable. Look in my code for
my variable WindowObjectReference. Also, do not set the height to 650
for several reasons. Basically, cpu, RAM, and time will be wasted on
parsing, adjusting and then resetting such height to something much
smaller on 800x600 scr. res.
Btw, your subwindow1 var does nothing here.
I stronly encourage you to keep
scrollbars=yes,resizable=yes,status=yes
as they are in your code: believe me, your users will not be irritated
by that.

Also,

Ten Good Deeds in Web Design
"8. Use link titles to provide users with a preview of where each link
will take them, before they have clicked on it."
http://www.useit.com/alertbox/991003.html

"Until user agents allow users to turn off spawned windows, do not cause
pop-ups or other windows to appear and do not change the current window
*_without informing the user_*.
(...)if your link spawns a new window, or causes another windows to "pop
up" on your display, or move the focus of the system to a new FRAME or
Window, then the nice thing to do is to tell the user that something
like that will happen."
W3C Web Accessibility Initiative Checkpoint 10.1
http://www.w3.org/WAI/wcag-curric/sam77-0.htm

That's why more and more sites (Microsoft, Sun Microsystems, WAVE 3.0,
accessibility sites, J. Nielsen) use and/or recommend to use the title
attribute and/or an image icon clearly indicating that clicking this
link will open a new window (sub-window).

If you need more, just check recent posts I did in this newsgroup and in
alt.html on this whole issue.
Thanks
Venkat


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.