devxlogo

February 21, 2007

Improved JavaScript Error Handling

To supress JavaScript error messages, simply place this snippet in the Head section of your Web page: &ltSCRIPT language=”JavaScript”&gtfunction dontshowerrormessages() {return true;}window.onerror=dontshowerrormessages; An even better method is to use the

Building Absolute/Relative URIs

This tip show you how to build absolute/relative URIs by using the java.net.URI methods. Building an absolute URI: try{ URI uri_absolute=new URI(“http://www.java.sun.com/”); URI uri_relative=new URI(“index.html”); URI uri_absolute_result=uri_absolute.resolve(uri_relative); System.out.println(uri_absolute_result); }catch(URISyntaxException e)