Tuesday, September 30, 2003

Open maximised window (JavaScript)

The following will open a maximised window, with scrollbars, menubar, but no toolbar (only works with links to pages on the same site - ../folder/file.htm or /folder/file.html not http://www.google.com - Access denied error will occur):

function showDocument(sDocURL){
	var newwin = window.open(sDocURL,'newwin','scrollbars=yes,toolbar=no,menubar=yes');
	return false;

Call function as follows: <a href="../folder/file.htm" onclick="showDocument(this.href); return false">File</a>
Will set focus on page and replace any existing page that was called in the same way.

No comments: