Welcome Guest, Not a member yet? Register   Sign In
close window with JS
#1

[eluser]umbungo[/eluser]
I am trying to create a 'close' link which closes the page when clicked, preferably with no confirmation.

How can i implement this (top suggestion/'nick') with CI??
#2

[eluser]umbungo[/eluser]
Here is the relevant info from the link...
Code:
Instead of calling window.close() redirect to another page.

Opening Page:

alert("No whammies!");
    window.open("closer.htm", '_self');

Redirect to another page. This fools IE into letting you close the browser on this page.

Closing Page:

[removed]

    window.close();

So how can i get this to work with CI; i tried creating a closer.htm in my http folder (above application) and linking to this however this would not work. I also tried creating a controller which echo'd this which did not work either..
#3

[eluser]umbungo[/eluser]
I currently have; Link page (view):
Code:
<a href="#">close</a>

<skript type="text/javascript">
function closer() {
    window.open("/closer", '_self');
};
</skript>
Then a controller called closer:
Code:
&lt;?php
class Closer extends Controller {
    function index(){
        $this->load->view('closer.htm');
    }
}
and a closer.htm file in /views:
Code:
<skript type="text/javascript">window.close();</skript>

But it doesn't close the tab.

Any help would be much appreciated!




Theme © iAndrew 2016 - Forum software by © MyBB