Create POPUNDER windows in JavaScript

In Javascript you can easily create POPUNDER windows by using window.open method.

window.open takes three parameters like URL for POPUNDER window, POPUNDER window name and height, width, location.. for popunder window.

The code to create POPUNDER window look like below.

 
<html> <head> <title>popunder page</title> </head> <body onclick="javascript:loadpopunder();" > <div> <script type="text/javascript"> var left = (screen.width/2)-(800/2); var top = (screen.height/2)-(600/2); var winfeatures='width=800,height=600,scrollbars=0,location=0, resizable=0,top='+top+', left='+left + ',scrollbars=yes'; function loadpopunder(){ win2=window.open("popunderwin.html","window1",winfeatures) win2.blur() win2.moveTo(screen.availWidth/2-(800/2),screen.availHeight/2-(600/2)); document.getElementById("hf_count").value = 2; window.focus() } win2=window.open("popunderwin.html","window1",winfeatures) win2.blur() win2.moveTo(screen.availWidth/2-(800/2),screen.availHeight/2-(600/2)); window.focus(); </script> </div> </body> </html>

If you observe above code, you can find , we are calling popunder window two times, one will display when your browser will load and another for when you click on the body.
Why, because in some browsers popunders may not display but, when user click on body it will display.

I tested this with major browsers like firefox,IE ..., it works fine.
Download source code here

Recent Articles

CLR integartion in SQL Server
Create, Read and Write Files in .Net
Message Queue in .Net
Deploy Asp.Net Web Site
Queues in Vb.Net
If you have any queries or doubts post at Forum
Share on Facebook
Responses(post your response or comments below)
Name *

Email * (won't be published)

Response *