Notify the calling window

  • killercelery
  • Newbie
  • Newbie
  • killercelery
  • Posts: 13
  • Loc: Montréal, Québec

Post 3+ Months Ago

Hi,
does anyone knows if it's possible to notify a calling window (the one opening another using : newWin = window.open...) from the callee?

I want to notify the caller that the callee has finished what it had to do and that the caller may proceed with what it has to do.

So far, I tried calling a function of the calling window from the callee like that:
Code: [ Select ]
<script type="text/javascript">
function NotifyCaller(){
  window.opener.BeNotify();
}
</script>
  1. <script type="text/javascript">
  2. function NotifyCaller(){
  3.   window.opener.BeNotify();
  4. }
  5. </script>


it gives me an "object doesn't support this property or method" error

in the calling window, I just want to check that the callee didn't had any error. since the callee should close itself if there was no error, in my BeNotify function, I check if the callee is closed, if not I close it and prompt the user with an error like this :

Code: [ Select ]
<script type="text/javascript>
function BeNotify(){
  if(!newWin.closed){
    winNew.close();
    alert("There was an error");
  }
}
</script>
  1. <script type="text/javascript>
  2. function BeNotify(){
  3.   if(!newWin.closed){
  4.     winNew.close();
  5.     alert("There was an error");
  6.   }
  7. }
  8. </script>


another problem I have is that if there is an error in the callee, the code stops to execute and doesn't call the caller function.

So basically, all I want to do is notify the calling window when the callee window is done (this window is only ASP, hidden window that runs a Transac SQL string and then close) or if an error occurs.

I hope it's clear, if not I will clarify.

Thanks all
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • killercelery
  • Newbie
  • Newbie
  • killercelery
  • Posts: 13
  • Loc: Montréal, Québec

Post 3+ Months Ago

Update:

The function call from the callee does work, it seems it was a cache problem and not a code problem, but, as I thought, if the page indeed has an error, the code stops so it won't call the caller function.

if anyone wants to call a caller function from the callee window, use this:

Code: [ Select ]
  window.opener.The_Function_Name();



Does anyone knows if it's possible to put an error routine so that when an error occurs, some code is executed (as the try --> catch sequence in C++)?

Thanks

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 122 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.