Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: onfoucus and onclick events


Message #1 by arsal01@h... on Thu, 21 Nov 2002 18:08:23
Hi Arsalan,
you could just make sure, that closingOption can not be entered twice. 
What about:

var inClosingOption= false;
function closingOption() {
  if (inClosingOption) return;
  inClosingOption= true;
//  try {
  if (window.confirm("close window?")) {
     // do something
  } else {
     // do something
  }
//  } finally {
  inClosingOption= false;
//  }
}

The try { } finally { } clause is not necessary, but it helpes to make the 
code airtight.

regards,
Volker

  Return to Index