I have an HTML page which has two frames on it - Header and Body are the
frame names.

Is it possible to resize the window containing the html frames when the ASP
page being displayed in the Body frame is loaded and reloaded?

I guess what I am asking is how do I reference to the window containing the
HTML page from one of the pages being displayed in one of the frames.

If this can be done, can anyone supply some code segments for me to achieve
this?

Paul Smith

Re: Frames and Window Resizing by \

\
Fri Feb 17 17:45:22 CST 2006

> I have an HTML page which has two frames on it - Header and Body are the
> frame names.

> Is it possible to resize the window containing the html frames when the ASP
> page being displayed in the Body frame is loaded and reloaded?

> I guess what I am asking is how do I reference to the window containing the
> HTML page from one of the pages being displayed in one of the frames.

Putting this code in either of the framed pages will change the frame sizes.

parent.document.all.tags("frameset")(0).rows="200,*"

BTW, I would STRONGLY recommend not using "body" as a frame name!
--
Crash
"Virtue is insufficient temptation." -- George Bernard Shaw



Re: Frames and Window Resizing by Paul

Paul
Sat Feb 18 04:09:11 CST 2006

I do not want to change the FRAME size, I want to change the overall WINDOW
size!

Anyone else any ideas?

Paul Smith


""Crash" Dummy" <dvader@deathstar.mil> wrote in message
news:Ovx%234wBNGHA.2064@TK2MSFTNGP09.phx.gbl...
>> I have an HTML page which has two frames on it - Header and Body are the
>> frame names.
>
>> Is it possible to resize the window containing the html frames when the
>> ASP
>> page being displayed in the Body frame is loaded and reloaded?
>
>> I guess what I am asking is how do I reference to the window containing
>> the
>> HTML page from one of the pages being displayed in one of the frames.
>
> Putting this code in either of the framed pages will change the frame
> sizes.
>
> parent.document.all.tags("frameset")(0).rows="200,*"
>
> BTW, I would STRONGLY recommend not using "body" as a frame name!
> --
> Crash
> "Virtue is insufficient temptation." -- George Bernard Shaw
>
>



Re: Frames and Window Resizing by uguraslan

uguraslan
Sat Feb 18 20:01:19 CST 2006

Hello,

You can do it with window.parent object in javascript. I wrote for an
example for you. You can check this link below:

http://www.uguraslan.net/examples/js/frame_top_window_resize/

You can change trigger event handler for the resize function as you like.
You can use ASP to write javascript when needed.

Ugur Aslan


"Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
> I do not want to change the FRAME size, I want to change the overall
WINDOW
> size!
>
> Anyone else any ideas?
>
> Paul Smith
>



Re: Frames and Window Resizing by Paul

Paul
Sun Feb 19 04:37:55 CST 2006

Thank you very much for your effort and especially the example, I now have
what I require to progress my project.

I wonder if I could ask you another question, which I am sure is within the
scope of your expertise.

I would like to place a button within one of the frame, so it will obviously
be on one of the ASP pages which will be displayed within one of the forms.
I would like this button to close the whole window when it is clicked. Is
this possible, and if so what would the JavaScript required be?

Many thanks,

Paul Smith



"uguraslan" <ugur(at)uguraslan.net> wrote in message
news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> You can do it with window.parent object in javascript. I wrote for an
> example for you. You can check this link below:
>
> http://www.uguraslan.net/examples/js/frame_top_window_resize/
>
> You can change trigger event handler for the resize function as you like.
> You can use ASP to write javascript when needed.
>
> Ugur Aslan
>
>
> "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
>> I do not want to change the FRAME size, I want to change the overall
> WINDOW
>> size!
>>
>> Anyone else any ideas?
>>
>> Paul Smith
>>
>
>



Re: Frames and Window Resizing by uguraslan

uguraslan
Sun Feb 19 05:51:45 CST 2006

Hello again,

Before answering your question, I should explain an issue related closing a
browser window via javascript:

Javascript can close browser windows if you use "window.close()" method. If
your javascript in a frame of a window, you can use it as
"window.parent.close()". Accessing the main browser window is carried out
with "window.parent" object which refers to the window that contains all the
frames in a web page. For any "window" method, you can use "window.parent"
object in any frame in your web page.

Ýf your window (holding all your frames) was opened via another javascript
"window.open" method in another page, you can happily use
window.parent.close() and close the window. If your page is not opened via
javascript "window.open" method, when you use "window.parent.close()"
method, you will get an confirmation warning that says like "The window want
to close itself, do you approve?". As far as I see, this is because of
security reasons. I couldn't find any "good" workaround in order
confirmation warning not to be shown.

If you don't mind confirmation message, you can use it
"window.parent.close()".

Regards,
Ugur Aslan


"Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
news:43f84a81$0$9252$ed2619ec@ptn-nntp-reader01.plus.net...
> Thank you very much for your effort and especially the example, I now have
> what I require to progress my project.
>
> I wonder if I could ask you another question, which I am sure is within
the
> scope of your expertise.
>
> I would like to place a button within one of the frame, so it will
obviously
> be on one of the ASP pages which will be displayed within one of the
forms.
> I would like this button to close the whole window when it is clicked. Is
> this possible, and if so what would the JavaScript required be?
>
> Many thanks,
>
> Paul Smith
>
>
>
> "uguraslan" <ugur(at)uguraslan.net> wrote in message
> news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
> > Hello,
> >
> > You can do it with window.parent object in javascript. I wrote for an
> > example for you. You can check this link below:
> >
> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
> >
> > You can change trigger event handler for the resize function as you
like.
> > You can use ASP to write javascript when needed.
> >
> > Ugur Aslan
> >
> >
> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> > news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
> >> I do not want to change the FRAME size, I want to change the overall
> > WINDOW
> >> size!
> >>
> >> Anyone else any ideas?
> >>
> >> Paul Smith
> >>
> >
> >
>
>



Re: Frames and Window Resizing by Paul

Paul
Sun Feb 19 06:30:15 CST 2006

Is there any way that the function could be amended to centre the resized
without on the screen?

Many thanks,

Paul Smith




"uguraslan" <ugur(at)uguraslan.net> wrote in message
news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> You can do it with window.parent object in javascript. I wrote for an
> example for you. You can check this link below:
>
> http://www.uguraslan.net/examples/js/frame_top_window_resize/
>
> You can change trigger event handler for the resize function as you like.
> You can use ASP to write javascript when needed.
>
> Ugur Aslan
>
>
> "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
>> I do not want to change the FRAME size, I want to change the overall
> WINDOW
>> size!
>>
>> Anyone else any ideas?
>>
>> Paul Smith
>>
>
>



Re: Frames and Window Resizing by Paul

Paul
Sun Feb 19 06:33:52 CST 2006

I think I am doing to be okay.

When a user opens the web site via a URL they will obviously already have a
Window open. It is not this window I am trying to close. From the main
page, various sections are accessed by opening a new window and this is done
via JavaScript. It will be these widows that I am trying to close, so I
think your code below will work without issue.

I will try your code, thanks.

Paul Smith


"uguraslan" <ugur(at)uguraslan.net> wrote in message
news:%23lC0krUNGHA.3944@tk2msftngp13.phx.gbl...
> Hello again,
>
> Before answering your question, I should explain an issue related closing
> a
> browser window via javascript:
>
> Javascript can close browser windows if you use "window.close()" method.
> If
> your javascript in a frame of a window, you can use it as
> "window.parent.close()". Accessing the main browser window is carried out
> with "window.parent" object which refers to the window that contains all
> the
> frames in a web page. For any "window" method, you can use "window.parent"
> object in any frame in your web page.
>
> Ýf your window (holding all your frames) was opened via another javascript
> "window.open" method in another page, you can happily use
> window.parent.close() and close the window. If your page is not opened via
> javascript "window.open" method, when you use "window.parent.close()"
> method, you will get an confirmation warning that says like "The window
> want
> to close itself, do you approve?". As far as I see, this is because of
> security reasons. I couldn't find any "good" workaround in order
> confirmation warning not to be shown.
>
> If you don't mind confirmation message, you can use it
> "window.parent.close()".
>
> Regards,
> Ugur Aslan
>
>
> "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> news:43f84a81$0$9252$ed2619ec@ptn-nntp-reader01.plus.net...
>> Thank you very much for your effort and especially the example, I now
>> have
>> what I require to progress my project.
>>
>> I wonder if I could ask you another question, which I am sure is within
> the
>> scope of your expertise.
>>
>> I would like to place a button within one of the frame, so it will
> obviously
>> be on one of the ASP pages which will be displayed within one of the
> forms.
>> I would like this button to close the whole window when it is clicked.
>> Is
>> this possible, and if so what would the JavaScript required be?
>>
>> Many thanks,
>>
>> Paul Smith
>>
>>
>>
>> "uguraslan" <ugur(at)uguraslan.net> wrote in message
>> news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
>> > Hello,
>> >
>> > You can do it with window.parent object in javascript. I wrote for an
>> > example for you. You can check this link below:
>> >
>> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
>> >
>> > You can change trigger event handler for the resize function as you
> like.
>> > You can use ASP to write javascript when needed.
>> >
>> > Ugur Aslan
>> >
>> >
>> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
>> > news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
>> >> I do not want to change the FRAME size, I want to change the overall
>> > WINDOW
>> >> size!
>> >>
>> >> Anyone else any ideas?
>> >>
>> >> Paul Smith
>> >>
>> >
>> >
>>
>>
>
>



Re: Frames and Window Resizing by uguraslan

uguraslan
Sun Feb 19 07:42:30 CST 2006

I have changed the code that I wrote previosly a bit. You can try again:

http://www.uguraslan.net/examples/js/frame_top_window_resize/

It is not a professional approac to the problem but it works. You, maybe,
should consider cross-browser compatibility, and change the code.

I hope it helps.

Regards,
Ugur Aslan

"Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
news:43f864d5$0$9273$ed2619ec@ptn-nntp-reader01.plus.net...
> Is there any way that the function could be amended to centre the resized
> without on the screen?
>
> Many thanks,
>
> Paul Smith
>
>
>
>
> "uguraslan" <ugur(at)uguraslan.net> wrote in message
> news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
> > Hello,
> >
> > You can do it with window.parent object in javascript. I wrote for an
> > example for you. You can check this link below:
> >
> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
> >
> > You can change trigger event handler for the resize function as you
like.
> > You can use ASP to write javascript when needed.
> >
> > Ugur Aslan
> >
> >
> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> > news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
> >> I do not want to change the FRAME size, I want to change the overall
> > WINDOW
> >> size!
> >>
> >> Anyone else any ideas?
> >>
> >> Paul Smith
> >>
> >
> >
>
>



Re: Frames and Window Resizing by \

\
Sun Feb 19 08:15:55 CST 2006

> Is there any way that the function could be amended to centre the resized
> without on the screen?

Yes, but there is a catch. You need to know the width and height dimensions of
the browser, and there is no way (that I know of) to read it if it is unknown.
So you would pretty much have to combine the resize and centering operations as
shown in Ugar Aslan's code.

I would only add that you might want to use screen.availWidth and
screen.availHeight instead of screen.Width and screen.Height because they allow
for the taskbar and any installed toolbars. Play with it and see what you like.
Also, since this is a vbscript group, the same code, adjusted for protocol, will
work in VBScript.
--
Crash
"Sanity is a madness put to good use. " -- George Santayana



Re: Frames and Window Resizing by Paul

Paul
Sun Feb 19 08:58:18 CST 2006

Thanks again your code works very well, although I modified it using Crash's
suggestion as it looks slightly better.

I am wondering whether I would need to put this code in every page, or
whether I can somehow store it locally like functions and call it from every
page. Can you 'Include' a file with JavaScript and have it globally
available?

Paul Smith


"uguraslan" <ugur(at)uguraslan.net> wrote in message
news:evRMZpVNGHA.3272@tk2msftngp13.phx.gbl...
>I have changed the code that I wrote previosly a bit. You can try again:
>
> http://www.uguraslan.net/examples/js/frame_top_window_resize/
>
> It is not a professional approac to the problem but it works. You, maybe,
> should consider cross-browser compatibility, and change the code.
>
> I hope it helps.
>
> Regards,
> Ugur Aslan
>
> "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> news:43f864d5$0$9273$ed2619ec@ptn-nntp-reader01.plus.net...
>> Is there any way that the function could be amended to centre the resized
>> without on the screen?
>>
>> Many thanks,
>>
>> Paul Smith
>>
>>
>>
>>
>> "uguraslan" <ugur(at)uguraslan.net> wrote in message
>> news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
>> > Hello,
>> >
>> > You can do it with window.parent object in javascript. I wrote for an
>> > example for you. You can check this link below:
>> >
>> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
>> >
>> > You can change trigger event handler for the resize function as you
> like.
>> > You can use ASP to write javascript when needed.
>> >
>> > Ugur Aslan
>> >
>> >
>> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
>> > news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
>> >> I do not want to change the FRAME size, I want to change the overall
>> > WINDOW
>> >> size!
>> >>
>> >> Anyone else any ideas?
>> >>
>> >> Paul Smith
>> >>
>> >
>> >
>>
>>
>
>



Re: Frames and Window Resizing by uguraslan

uguraslan
Sun Feb 19 09:31:43 CST 2006

If you want to include javascript function you can do it in the head section
of any page like:

<script src="javascript.js" language="javascript"
type="text/javascript"></script>

You should create your javascript.js by putting your javascript code without
any "<script>" tag.

Regards,
Ugur Aslan


"Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
news:43f88788$0$9241$ed2619ec@ptn-nntp-reader01.plus.net...
> Thanks again your code works very well, although I modified it using
Crash's
> suggestion as it looks slightly better.
>
> I am wondering whether I would need to put this code in every page, or
> whether I can somehow store it locally like functions and call it from
every
> page. Can you 'Include' a file with JavaScript and have it globally
> available?
>
> Paul Smith
>
>
> "uguraslan" <ugur(at)uguraslan.net> wrote in message
> news:evRMZpVNGHA.3272@tk2msftngp13.phx.gbl...
> >I have changed the code that I wrote previosly a bit. You can try again:
> >
> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
> >
> > It is not a professional approac to the problem but it works. You,
maybe,
> > should consider cross-browser compatibility, and change the code.
> >
> > I hope it helps.
> >
> > Regards,
> > Ugur Aslan
> >
> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> > news:43f864d5$0$9273$ed2619ec@ptn-nntp-reader01.plus.net...
> >> Is there any way that the function could be amended to centre the
resized
> >> without on the screen?
> >>
> >> Many thanks,
> >>
> >> Paul Smith
> >>
> >>
> >>
> >>
> >> "uguraslan" <ugur(at)uguraslan.net> wrote in message
> >> news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
> >> > Hello,
> >> >
> >> > You can do it with window.parent object in javascript. I wrote for an
> >> > example for you. You can check this link below:
> >> >
> >> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
> >> >
> >> > You can change trigger event handler for the resize function as you
> > like.
> >> > You can use ASP to write javascript when needed.
> >> >
> >> > Ugur Aslan
> >> >
> >> >
> >> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> >> > news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
> >> >> I do not want to change the FRAME size, I want to change the overall
> >> > WINDOW
> >> >> size!
> >> >>
> >> >> Anyone else any ideas?
> >> >>
> >> >> Paul Smith
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Re: Frames and Window Resizing by Paul

Paul
Mon Feb 20 15:18:35 CST 2006

I cannot seem to get this working, can you tell me why?

I have created a file called javascript.js and saved it in the same
directory as the target file.

In javascript.js is just the following text:

function ResizeWin(width, height){
window.parent.resizeTo(width,height);
}

In the target file, in the header, I have the following line:

<script src="javascript.js" language="javascript"
type="text/javascript"></script>

Also in the target file I have the following line:

<Body onload="ResizeWin (820,720)">

Previously when the function was within <script. tag in the target's header
the function worked, however now I am trying to refer to it in an separate
file it does not work.

Any ideas?

Paul Smith



"uguraslan" <ugur(at)uguraslan.net> wrote in message
news:uxZsamWNGHA.1488@TK2MSFTNGP14.phx.gbl...
> If you want to include javascript function you can do it in the head
> section
> of any page like:
>
> <script src="javascript.js" language="javascript"
> type="text/javascript"></script>
>
> You should create your javascript.js by putting your javascript code
> without
> any "<script>" tag.
>
> Regards,
> Ugur Aslan
>
>
> "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
> news:43f88788$0$9241$ed2619ec@ptn-nntp-reader01.plus.net...
>> Thanks again your code works very well, although I modified it using
> Crash's
>> suggestion as it looks slightly better.
>>
>> I am wondering whether I would need to put this code in every page, or
>> whether I can somehow store it locally like functions and call it from
> every
>> page. Can you 'Include' a file with JavaScript and have it globally
>> available?
>>
>> Paul Smith
>>
>>
>> "uguraslan" <ugur(at)uguraslan.net> wrote in message
>> news:evRMZpVNGHA.3272@tk2msftngp13.phx.gbl...
>> >I have changed the code that I wrote previosly a bit. You can try again:
>> >
>> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
>> >
>> > It is not a professional approac to the problem but it works. You,
> maybe,
>> > should consider cross-browser compatibility, and change the code.
>> >
>> > I hope it helps.
>> >
>> > Regards,
>> > Ugur Aslan
>> >
>> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
>> > news:43f864d5$0$9273$ed2619ec@ptn-nntp-reader01.plus.net...
>> >> Is there any way that the function could be amended to centre the
> resized
>> >> without on the screen?
>> >>
>> >> Many thanks,
>> >>
>> >> Paul Smith
>> >>
>> >>
>> >>
>> >>
>> >> "uguraslan" <ugur(at)uguraslan.net> wrote in message
>> >> news:erBIkhPNGHA.3144@TK2MSFTNGP15.phx.gbl...
>> >> > Hello,
>> >> >
>> >> > You can do it with window.parent object in javascript. I wrote for
>> >> > an
>> >> > example for you. You can check this link below:
>> >> >
>> >> > http://www.uguraslan.net/examples/js/frame_top_window_resize/
>> >> >
>> >> > You can change trigger event handler for the resize function as you
>> > like.
>> >> > You can use ASP to write javascript when needed.
>> >> >
>> >> > Ugur Aslan
>> >> >
>> >> >
>> >> > "Paul W Smith" <pwsNOSPAM@twelve.me.uk> wrote in message
>> >> > news:43f6f245$0$9257$ed2619ec@ptn-nntp-reader01.plus.net...
>> >> >> I do not want to change the FRAME size, I want to change the
>> >> >> overall
>> >> > WINDOW
>> >> >> size!
>> >> >>
>> >> >> Anyone else any ideas?
>> >> >>
>> >> >> Paul Smith
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Re: Frames and Window Resizing by kyle

kyle
Sun Feb 26 14:14:40 CST 2006

Ive always found vbscipt the best when programming in the html areas.
This script should be suitable:

<script language="vbscript">
Dim x,y,k

child.Window.ReSizeTo C_ScreenW,300 ' Height
Const C_ScreenW=700 'Width
</script>

All the best
Kyle..



Re: Frames and Window Resizing by Randy

Randy
Sun Feb 26 15:49:11 CST 2006

kyle pawlaczyk said the following on 2/26/2006 3:14 PM:
> Ive always found vbscipt the best when programming in the html areas.

Then you have never tested it in anything other than IE on Windows?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/