spawnig 2 windows from one link

Associate
Joined
19 Jul 2006
Posts
1,847
if i have a link is there a way of getting it to open 2 new windows but both going to different addresses,
eg
click here would open up a window for google and another window with yahoo in
 
Code:
<html>
<head>
<script language='Javascript'>

function openWindows()
{
	window.open('http://www.google.com', 'Window1', 'toolbar,width=150,height=100');
	window.open('http://www.microsoft.com', 'Window2', 'toolbar,width=150,height=100');
}

</script>
</head>


<body>
<a href = "javascript:openWindows()">click here</a>
</body>
</html>
 
This code will change the current page to Yahoo and open a new page for Google.

Code:
<a href="http://www.yahoo.com" onclick="window.open('http://www.google.com','newwin');">click me</a>

There are other ways to do it by using Javascript or DHTML but they seem to be for websites using frames.


Dan

*EDIT* Just seen the above post :p
 
Back
Top Bottom