Jump to content

Error while trying to close a window using script


abhishekdeveloper

Recommended Posts

Dear All,

 

 

Below is my script for closing a window, I intend to close the window. Please help me out.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
       
       <title>

       
       Thank you!
       
       </title>

       
<body bgcolor="#808080">

                       <br>
                       <br>
               <h2><P ALIGN=Center>Thank you for voting on our website!</h2>
               <h3><P ALIGN=Center>We will e-mail you the results of the experiment shortly!</h3>
                       <br>
                       <br>
               <P ALIGN=Center><a href="login_success.php">Click here to go back and change your votes</a>
               <br>
               <br>
               <P ALIGN=Center><a href="" onclick="window.close();return false;">Click here to close this window</a>        
</body>


</html>

 

It is not working as I intend it to work, any suggestions??

Link to comment
Share on other sites

Even if I try the below code, it gives me the error:

 

Not Found

 

The requested URL /self.close() was not found on this server.

 

Here's the script:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<title>


Thank you!

</title>


<body bgcolor="#808080">

		<br>
		<br>
	<h2><P ALIGN=Center>Thank you for voting on our website!</h2>
	<h3><P ALIGN=Center>We will e-mail you the results of the experiment shortly!</h3>
		<br>
		<br>
	<P ALIGN=Center><a href="login_success.php">Click here to go back and change your votes</a>
	<br>
	<br>
	<P ALIGN=Center><a href="self.close()">Click here to close this window</a>	
</body>


</html>

 

Please suggest modifications asap. Thank you.

Link to comment
Share on other sites

What window are you trying to close then? If you're not trying to close a child window is it a main window or something completely different? You must know if its being created with JavaScript or not because you would have created it.

Link to comment
Share on other sites

It is a page written in html/php, i tried HTML script using self.close() but it is also giving the not found error...help!

 

What window are you trying to close then? If you're not trying to close a child window is it a main window or something completely different? You must know if its being created with JavaScript or not because you would have created it.

Link to comment
Share on other sites

So you open an entirely new window and then want to close it so they can view the main website again? In that case top.close() document.close() window.close() parent.window.close() should all work....

Link to comment
Share on other sites

I am sorry but same error....I guess I need to put the source code file on the server in the same folder for all these functions self.close, windows.close() etc.

 

So you open an entirely new window and then want to close it so they can view the main website again? In that case top.close() document.close() window.close() parent.window.close() should all work....

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.