Showing posts from June, 2011

Javascript A simple grayed out overlay

Overlay One of the most adopted feature of web2.0 is the use of a grayed out overlay panel. Overlay is useful to insert a new page inside the current page.. Almost all the javascript libraries available today comes with the overlay feature inbuilt. Below is the code snippet for overlay using plain js and html without any libraries. Code <HTML> <BODY> The javascript code to display and hide the overlay. <script type="text/javascript"> function disable1() { var blurDiv = document.createElement("div"); = "blurDiv"; = "position:absolute; top:0; right:0; width:" + screen.width + "px; height:" + screen.height + "px;background-color: #000000; opacity:0.5; filter:alpha(opacity=50)"; var aDiv = document.createElement("div"); aDiv.appendChild(document.createTextNode("Overlay panel")); = "aDiv"

Debugging minified/obfuscated javascript on production

What is minified or packed JS  Minification is the practice of removing unnecessary characters from code to reduce its size thereby improving load times. When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced. Two popular tools for minifying JavaScript code are JSMin and YUI Compressor.  YUI compressor to minify a js  java -jar yuicompressor*.jar inputFile.js -o inputFile-min.js   Obfuscation  Obfuscation is an alternative optimization that can be applied to source code. Like minification, it removes comments and white space, but it also munges the code. As part of munging, function and variable names are converted into smaller strings making the code more compact as well as harder to read.   Debugging minified js  Following the best practices, the javascript files in production are minified/

Jconsole configuration - Tomcat

JMX local/remote monitoring configuration for tomcat using JConsole. Start tomcat with the following self-explanatory params. 1. 2. 3. 4. These two params are to solve RMI transport issues of java 1.6 5. -Djava.rmi.server.hostname=localhost 6. Unix/Linux export CATALINA_OPTS="" Windows On windows set each parameter separately, otherwise you must use line separator (\). set set CATALINA_OPTS=%CATALINA_OPTS% set CATALINA_OPTS=%CATALINA_OPTS%