Page 1 of 1

JavaScript Pop Up Window Code

Posted: Thu Oct 27, 2011 10:11 am
by Nipuna
When I was searching for a JavaScript pop up window code for freelancer work of mine. I found this and this just what I needed

To create a popup you'll need the following script:

Code: Select all

<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
	newwindow=window.open(url,'name','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
}

// -->
</script>
Then, you link to it by:

Code: Select all

<a href="popupex.html" onclick="return popitup('https://robot.lk')"
	>Link to popup</a>
Have fun with it :)