Warning: include(/home3/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: No such file or directory in /home/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/wp-cache.php on line 65

Warning: include(): Failed opening '/home3/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/wp-cache.php on line 65

Warning: include_once(/home3/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: No such file or directory in /home/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/wp-cache.php on line 82

Warning: include_once(): Failed opening '/home3/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/agurchan/public_html/theonlytutorials/wp-content/plugins/wp-super-cache/wp-cache.php on line 82
How to create JavaScript Popup Window (open new window javascript) - TheOnlyTutorials.com

How to create JavaScript Popup Window (open new window javascript)

Creating popup using JavaScript is not so tough, Here is the code that will do the magic. Just copy and paste and start using it!

There are number of ways to create Javascript Popup

Method 1:


<html>
<head>

<script language="javascript" type="text/javascript">

function popup() {
window.open('http://www.theonlytutorials.com','name','height=500,width=600');
}
</script>

</head>
<body>
<a href="#" onclick="popup()">Open Popup</a>
</body>
</html>

See the ouput for the above code here:

Open Popup

When you click the above link my site will open 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');

[ad][ad]

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.playvideos.in','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!.

Leave a Reply