Please Wait...

The credit card processing on the admissions application can take quite a bit of time. Sometimes so much users were closing their browser pre-maturely, causing errors in the processing process and accounting. You can't control users closing a browser, but I wanted to at least give them notice that something was happening.

I created a pop-up window asking them to wait for the credit process to complete, and then closes once the final page loads. This was a lot more complicated than it sounds, and it's taken me all week to figure it out. There were cross domain issues for windows reading information off other windows that I found out about, as well as banner specific issues. Since I was opening the popup from one procedure and wanting it to close in another, I didn't have access to the variable created using window.open.

How I managed to get around this issue was using window.opener.parent.name, setting the name to end in my final procedure. In my popup, I setInterval("checkup();", 1000); to check window.opener.parent.name for equality to "end" once a second and closed itself when that was the case:

<script type="text/javascript">
<!--
function setup(){
  setInterval("checkupdate()", 1000);
}
function checkupdate(){
  if(typeof window.opener == "object"){
    if(window.opener.parent.name == "end"){
      parent.focus();
      self.close();
    }
  }
}
-->
</script>
</head>
<body onload="setup();">

Then, within my application, on submitting the form, it pops the window up:
<script type="text/javascript">
<!--
  window.name='main';
  setTimeout("window.name='end'",5000);
  function wdw(){
    var width = 400;
    var height = 200;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var winfeatures = "titlebar=no,width="+width+
      ",height="+height+",dependent,copyhistory,left="+left+",top="+
      top +",screenX="+left+",screenY="+top;
    var newwin =  window.open("./hrglass.html", "waitWin", winfeatures);
    newwin.focus();
  }

-->
</script>
</head>
<body>
<form name="test" action="" onsubmit="wdw();">

About this Entry

This page contains a single entry by published on October 12, 2006 4:23 PM.

Production admissions app was the previous entry in this blog.

Portal Problem is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.23-en