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
>> >>
>> >
>> >
>>
>>
>
>