Friday, 2 March 2007

Opening a new browser window and maximising it..

I'm usually vehemently against this method of web development (never, ever break the back button!) but someone I know wanted to do this for their client, so I worked out a solution - I've pasted the code here so I can dole it out as and when needed... Obviously the usual disclaimer applies: don't do this unless you really have to!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">

<title>Home page</title>
<script type="text/javascript">

var uri;
var myWindow;

function openme(uri){
myWindow =, 'myWindow', 'toolbar=0,status=0,width=800,height=600')
if (navigator.appVersion.indexOf("Mac",0)>0) {
} else {



<h1>Index Page</h1>
<a href="javascript:void(0)" onClick="javascript:openme('home.html')">open me</a>
<p>This opens a new browser window</p>

No comments: