New Technologies

  • Java
  • Javascript
  • DTML
  • Dot Net
  • ASP .Net
  • C# .Net
  • PHP
Your Ad Here

Tuesday, March 18, 2008

How to over Popup windows

<script language="javascript">

//set object to hold windows

var oWindowsT = new Object();



function openWindowCheck(pageId) {

//open window

openWin(pageId);



//check if the window opened

setTimeout("checkOpen(\"" + pageId+ "\")",1000);

}





function checkOpen(pageId) {

try {

if ( (!oWindowsT[pageId]) || (oWindowsT[pageId].closed) ) {

//handle code how ever you want

var elem = window.document.getElementById("popupmsg");

elem.style.visibility = "visible";

} else {

var elem = window.document.getElementById("popupmsg");

elem.style.visibility = "hidden";

}

}catch(e){

//if unable to read var show message

}

}



function closeIt() {

window.document.getElementById("popupmsg").style.visibility = "hidden";

}

//open a window

function openWin(pageId) {

switch (pageId) {

case "page1":

//set window properties

var sPar = "width=500,height=500";

handle = window.open("http://rachasatish.blogspot.com/",pageId,sPar);

break;

case "page2":

//add code for another id

//handle = window.open(sURL,page,sPar);

break;

default:

}

//add handle to window object holder

oWindowsT[pageId] = handle;

}



</script>


<body onload="openWindowCheck('page1');" style="margin:0">

<style>

#msg{

background-color:#ccffff;

height:200;

width:200;

font-family:verdana

}

</style>

<div id="popupmsg" style="visibility:hidden;text-align:center;">

<div id="msg" style="">

^<br />

^<br />

^<br />

^<br />

It appears you have your popup blocker turned on for this site.

<br />

<a href="javascript:closeIt()">close</a>

</div>


</body>

No comments:

Your Ad Here