Create Javascript Popup Window [ How to ]

Open New Window Using Javascript

Creating popup using JavaScript is actually never so hard, Below is the code which will do the magic. Simply copy and paste to start using it!

There are variety of ways to create Javascript Popup

Method 1:


<html>
<head>
<script language="javascript" type="text/javascript">
function popup() {
window.open('http://www.theinfiniteinfo.com','name','height=500,width=600');
}
</script>
</head>
<body>
<a href="#" onclick="popup()">Open Popup</a>
</body>
</html>

When a person click the above link my blog will open up in a new window!

See the line no. 7 : Here i have given my site name instead you can give any page ‘popup.html’ or ‘subfolder/test.html’

window.open('http://www.theonlytutorials.com','name','height=500,width=600');

Method 2:

In the previous method we call a function outside of the ‘<body>’ Tag. Instead you can call in the ‘<a>’ tag itself, so no need to write the JavaScript Function inside the ‘<script>’ Tag!
See the Code Below:

<a onclick="javascript:window.open('http://www.downloadnp','PingStatistics','status=0,toolbar=0,menubar=0,scrollbars=1,location=0,resizable=0,width=500,height=800');" href="javascript:void(0);">
Click to Open Popup
</a>

Click to Open Popup

Test the Above link by Clicking it!.

0 Response to "Create Javascript Popup Window [ How to ]"

Post a Comment

Popular Posts

Popular Posts