Subscribe to our mailing list

* indicates required
Close

Monday, March 02, 2009

Stupid JavaScript Tricks: LackOfSomethingToDoException

function getVitalInfoFromUser( ) {

  var up = "LackOfSomethingToDoException";

  // if user Cancels, exit ungracefully
  
  var userInput = prompt ( "Enter something:", "[here]" );

  if ( null == userInput || userInput.length == 0 )
     throw up; // puke and die

}

No comments:

Post a Comment

Add a comment. Registration required because trolls.