Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2004, 12:46 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default Avoid Warning Message on C lose Windows

I have a web page and I want to display it on full screen. And for this I made an other page which open the first page on full screen. But I want to close the first page without any warning. Here is the code of that page

<script language="JavaScript">
var subdirectory = "";
function show_window()
    {
        top.window.open("Default.htm","","fullscreen,scrol lbars")
        clos()
    }


    function clos()
    {
    top.window.close()
    }
    </script>
</head>

<body onLoad="javascript:show_window()">


when this page is executed it dipalay the warning that this page is going to close Yes or NO
I want to avoid this message and close this window with out any warning


(*_*)

:D

Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
__________________
(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is&nbsp;&nbsp;how you got it
 
Old September 4th, 2004, 02:20 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

There is a hack for IE that gets rid of the message, but it won't work on other browsers.

Before the top.window.close() line, add this line:

top.opener = top;

HTH,

Snib

<><
 
Old September 10th, 2004, 10:53 AM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

why don't you just resize the window instead of closing it and openind another one?
 
Old September 10th, 2004, 11:09 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

isNaN,

By fullscreen, Numan means no toolbars, statusbar, titlebar, addressbar, etc. Removing these cannot be achieved without opening a new window, or perhaps with ActiveX (which I do not know).

HTH

Snib

<><
 
Old September 10th, 2004, 11:56 AM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oh I know what you mean now. But a message will come up when trying to close a window that wasn't opened by script. I don't see why you would wan't to do that. Can't you live with the other window open if it's not focus what difference does it make.

 
Old September 10th, 2004, 01:18 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Although I agree with you about living with the other window open, Numan asked for a way to close the window without the "this window was not opened by a script" warning, and I gave him one, at least for IE. There may be a similar hack for other browsers, but I don't know of any.

HTH

Snib

<><
 
Old September 10th, 2004, 02:00 PM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I know you gave a perfectly valid answer to the problem viewing on IE. I understand that he wanted to close the window. But I think it's is putting a lot of extra work in to make sure you come up with a way for every browser. When leaving the window open wouldn't make that much difference. Don't get me wrong I do get involved in site design and want to make it as perfect as possible. but I would leave out all of the if's and else if's that would be required if there are these hacks for every browser.

 
Old September 10th, 2004, 03:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

isNaN,

It is a good idea to avoid browser detection, but if it is the only way, sometimes it must be done. Myself, I would just leave the window open.

Anyway, I doubt there is a way to do this for every browser :-)

-Snib <><
http://www.snibworks.com/
 
Old September 11th, 2004, 01:54 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Hi Dears
Snib code is working very well in IE but as I open the full screen window then I want to make my own close and minimize button on it. And as for as the close button is concern I made it but remain problem in minimizing the window.
Any idea how to minimize the window?




Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
 
Old September 11th, 2004, 11:19 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

AFAIK you can't with a fullscreen window. window.blur() is the next best thing.

-Snib <><
http://www.snibworks.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning Message (Exception ex) dbcook8 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 December 1st, 2008 05:18 PM
Warning Window Message in Struts!!! petemotu Struts 0 September 25th, 2006 08:48 PM
Warning Message when creating Outlook email Paulsh Access VBA 3 September 5th, 2005 06:27 AM
Warning message NutzyNobs Beginning PHP 1 July 28th, 2005 02:31 PM
Warning Message AMP_Engineer BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 4 September 29th, 2004 08:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.