[thelist] js and redirection

Michael Mell mike at nthwave.net
Tue Nov 12 20:08:01 CST 2002


On Wednesday, November 13, 2002, at 10:41  AM, Le Sauvage wrote:

> i have a page (not the first page) open in fullscreen. on the page
> there is a
> button, say, CLOSE. what i want to achieve is to [1] have the window
> closes to
> normal size and then [2] get re-directed to another page by using the
> lines "JavaScript:window.close(self)" and "parent.location='about:home"

this isn't for one of those insane porn site endless window openers is
it?

If you can skip the close part, your fullscreen page should have this
link:
<a href="javascript: shrinkAndLoad('nextPage.html', 420,
520)">CLOSE</a>

If you must close the parent
&lt;a href="javascript: newWin('nextPage.html', 420, 520)">CLOSE</a>

put this is script in the head tag:
<script type="text/javascript">
function newWin(theURL, w, h, winName) {
	settings='width='+w+',height='+h+';
	win=window.open(theURL,winName,settings);
	self.close();
}
function shrinkAndLoad(url, w, h) {
	document.location.href = url;
	window.resizeTo(w, h); //for IE
	window.innerWidth = w; // for NS
	window.innerHeight = h;
}
</script>


untested: I pulled the code from working files.

m




More information about the thelist mailing list