Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After a recent "automatic update" f

Status
Not open for further replies.

JohnChapman

Programmer
Oct 28, 2002
3
US
After a recent "automatic update" from MS a javascript method for closing a browser window with the click of a button has stopped working. Now I get the following message "This operation can only function within HTML Help." in a pop-up window.

The old code to close the window:

<!-- --------------HEADER--------------- -->
<HTML>
<HEAD>
<TITLE>Arrow Electronics, Inc.</TITLE>

</HEAD>
<BODY BGCOLOR=&quot;#FFFFFF&quot; TEXT=&quot;#000080&quot;>
<center>

<!-- --------------TITLE--------------- -->
<FONT FACE=&quot;Arial, Times, serif&quot; SIZE=&quot;8&quot;>
<B> ACME Widgets </B>
</FONT>

<!-- --------------AUTHOR--------------- -->
<FONT FACE=&quot;Arial, Times, serif&quot; SIZE=&quot;4&quot;>
<P> This on-line course has been provided by: </P>
</FONT>

<FONT FACE=&quot;Arial, Times, serif&quot; SIZE=&quot;6&quot;>
<P> ACME Training Department </P>
</FONT>

<object id=closeWin type=&quot;application/x-oleobject&quot; classid=&quot;clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11&quot;>
<param name=&quot;Command&quot; value=&quot;Close&quot;>
</object>
<input type=button value=&quot;Click here to close this window.&quot; onClick=&quot;javascript: closeWin.Click();&quot;></p>
</center>

<!-- --------------FOOTER--------------- -->
</FONT>
</BODY>
</HTML>

I need a replacement method. Any suggestions. Thanks!

John
jchapman@onlinecbt.com
 
The following code segment works without error; however, a pop-up window appears (&quot;The Web page you are viewing is trying to close the window. Do you want to close this window? Yes or No&quot;).

<FORM ACTION=&quot;&quot; METHOD=POST name=CloseWindow><P align=&quot;center&quot;>
<FONT FACE=&quot;Arial,Helvetica,sans-serif&quot;>&nbsp;&nbsp; </FONT>
<input type=&quot;button&quot; value=&quot;Click here to close this window&quot;
onclick=&quot;top.window.close()&quot; style=&quot;color: #FFFFFF; font-weight: bold; background-color: #000080; border-style: outset&quot;>
</FORM>

I would like to bypass the exit confirmatation if possible. Any suggestions?

John
jchapman@onlinecbt.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top