
Published in Website Design on Thursday, 26 February 2009 |
Post RSS
This is a simple script that opens a link in a new browser window.
You can open links in an existing open window, or a brand new one.
Click me to replace the content of the first window with Google
Click me to open differrent window with Google
Put this code in the <head> of your page (or external JS file):
<script type="text/javascript">
function openWindow(theURL,winName) {
window.open(theURL,winName);
}
</script>
Use this code in the <body> of your page:
<p><a href="javascript:void()" onClick="openWindow('http://www.webfertile.co.uk', 'theNewWindow');">Click me to open a new window</a></p>
<p><a href="javascript:void()" onClick="openWindow('http://www.google.co.uk', 'theNewWindow');">Click me to replace the content of the first window with Google</a></p>
<p><a href="javascript:void()" onClick="openWindow('http://www.google.co.uk', 'anotherNewWindow');">Click me to open differrent window with Google</a></p>
Whatever your business needs, one of our highly trained small business development experts is sure to be able to help.
There are currently no comments to display.
web designers, javascript, nottingham
Welcome to WebFertile. We'd love you to join us and benefit from:
View project briefs, client comments + latest Google® performance.
WebFertile
The Hive Business Centre
NTU Buildings
Burton Street
Nottingham
NG1 4BU
0115 849 2660
07973 122 619