I dont know if any uses this little program but i like it for simple password protection of a file. It seemed to work for a while and now all of a sudden it keeps giving me opener.closed is null error message. this line is in the second code block. Also i've worked around it and removed that opener.closed line and now it when the correct password is put in it pops up a window telling me that the page im going to is trying to close the current window do i want to do this yes or no. All I want is after i put in the password is for the page to be brought up into the existing window like it used to. Suggestions?
Code:
<SCRIPT LANGUAGE="javascript">
<!--- Hide from tired old browsers
var nifty_little_window = null;
function gateKeeper() {
nifty_little_window = window.open('gatekeep.html', 'theKeeper',
'width=350,height=200,resizable=1');
}
// End hiding --->
</SCRIPT>
<form>
<input type="button" value="Enter Here" onClick="gateKeeper()"
</form>
Code:
<HTML>
<HEAD>
<TITLE>Gate Keeper</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--- Hide from tired old browsers that should be put to pasture.
////////////////////////////////////////////////////////////////////
/// Get your very own Gate Keeper from Professional Web Design ///
/// [URL unfurl="true"]http://junior.apk.net/~jbarta/weblinks/gate_keeper/[/URL] ///
////////////////////////////////////////////////////////////////////
function goForit() {
var location;
var password;
password=this.document.testform.inputbox.value
location=password + ".html"
fetch(location)
theKeeper=window.close()
}
function fetch(location) {
var root;
if (opener.closed) {
root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
root.location.href = location;
} else {
opener.location.href = location;
}
}
// End hiding --->
</SCRIPT>
</HEAD>