Notes by Dr. Xi

Displaying notes 121 - 130
Created by Dr. Xi on January 25, 2011 15:51:50    Last update: January 25, 2011 15:51:50
By default, Ant ignores any effort to change the value of a property once it's set. Take this build file: <?xml version="1.0" ?> <project name="test" def... The output is something like this: C:\tmp>ant Buildfile: C:\tmp\build.xml e... Adding the local task inside target will allow you to override the default value: <?xml version="1.0" ?> <project name="test" def... C:\tmp>ant Buildfile: C:\tmp\build.xml e...
Created by Dr. Xi on August 14, 2008 20:22:20    Last update: January 23, 2011 18:51:55
http://expsharing.blogspot.com/2007/09/documentbody-doctype-scroll-bar-height.html Offers good explanation of: clientWidth, clientHeight offsetWidth, offsetHeight scrollWidth, scrollHeight scrollTop, scrollLeft with doctype on and off. I'm adding two test pages, one without doctype , one with doctype . Without doctype (quirks mode): <html> <head> <title>Quirks Mode</title> ... With doctype (standard mode): <!doctype html> <html> <head> <title>Qui...
Created by Dr. Xi on January 22, 2011 20:26:05    Last update: January 22, 2011 20:26:05
Deciding which one to use is not that easy. Chrome and Safari always use document.body.scrollTop , while IE and Firefox use document.body.scrollTop for quirks mode and document.documentElement.scrollTop for standard mode. Your best bet may be something like: var scrollTop = document.body.scrollTop || doc... Test page for quirks mode: <html> <head> <title>Quirks Mode</title> ... Test page for standard mode: <!doctype html> <html> <head> <title>Sta...
Created by Dr. Xi on August 31, 2008 20:43:44    Last update: January 22, 2011 12:48:08
It's probably more useful to make the JavaScript executor a bookmarklet. That way it gains access to the page on which it is invoked. Therefore, more helpful while debugging. Here's the code: <html> <body> <a href="javascript:(funct... Or, you can add this link to your bookmarks, name it "JS Executor". For a full featured JavaScript console, you may need Jash
Created by Dr. Xi on November 23, 2010 20:41:28    Last update: January 14, 2011 16:15:20
The servlet API allows servlet filters to be inserted into the processing cycle to form a Filter Chain . How is a chain defined, and what is the ordering of filters in the chain? The servlet filter chain is formed by defining multiple filters for the same servlet or URL pattern in web.xml . The order in which the filters are invoked is the same order as <filter-mapping> s appear in the web.xml file. For example, if this is defined in web.xml : <!-- Filter mapping --> <filter-mapping> ... then servletFilter2 will be applied before servletFilter . Actually, it's more accurate to imagine these filters as layers or wraps instead of chains. In the above example, servletFilter2 wraps servletFilter .
Created by Dr. Xi on August 27, 2008 19:40:19    Last update: January 14, 2011 09:33:20
There's a limit to the number of characters a bookmarklet can contain. Browser Max chars Netscape > 2000 Firefox > 2000 Opera > 2000 IE 4 2084 IE 5 2084 IE 6 508 IE 6 SP 2 488 IE 7 ~2084 IE 8 ~2200-2300 I tried it in the IE6 browser. The following code (573 characters) doesn't work as a bookmarklet. However, <a href="alert('Hi');">Short Bookmarklet</a> works. Actually, you don't have to save the link as a bookmark in order to test, just click the link, nothing happens if the length limit is exceeded. <a href='javascript:alert("var c = document.create... If the bookmarklet code is too long, you can save the JavaScript code on a server and use this function to bring it back to the page:...
Created by Dr. Xi on October 26, 2010 04:47:37    Last update: January 11, 2011 20:00:36
The code presented here is a simple implementation of a tab set. It is used to demo how a tab set could be implemented. The code is stand alone and does not depend on any JavaScript libraries. Multiple tab sets within the same page is supported. The HTML markup is fairly simple: Tabs sets are contained within a DIV element with class name "tabsContainer". Define a UL list for the tabs. Follow the UL list with equal number of DIVs for the tab contents. The Nifty Corners Cube technique is used to draw the rounded corners (original form, not the enhanced JavaScript form). HTML, CSS and JavaScript: <!doctype html> <html> <head> <style typ...
Created by Dr. Xi on October 07, 2010 19:20:55    Last update: January 11, 2011 19:59:17
Like the string trim function, Firefox provides a native implementation for array map, IE doesn't. So we have to create our own map function for Array : if(typeof Array.prototype.map !== 'function') { ... Test page: <html> <head> <title>Array Map</...
Created by Dr. Xi on July 07, 2009 23:38:03    Last update: January 11, 2011 19:58:18
Demo page for HTML modal dialog. <html> <body> <button onclick="window.showM...
Created by Dr. Xi on October 03, 2008 02:36:41    Last update: January 11, 2011 19:53:25
Demo page to retrieve the value and text of a dropdown box using JavaScript. <html> <head> <script language="JavaScript" ...
Previous  8 9 10 11 12 13 14 15 16 17 Next