<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-37672055</id><updated>2011-12-14T18:39:15.845-08:00</updated><category term='i18n'/><category term='gears'/><category term='ecma'/><category term='dom'/><category term='javascript'/><category term='js'/><category term='php'/><category term='ajax'/><category term='multi-lingual'/><category term='offline'/><category term='id'/><category term='forking'/><category term='name'/><category term='MySql'/><category term='w3c'/><category term='threading'/><title type='text'>Busted Mug</title><subtitle type='html'>A blog that documents solutions to the most frustrating problems that occur during development in technologies such as Java, XML, AJAX, SQL, CSS and others that make me want to throw my coffee mug against the cube wall.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-37672055.post-672566280467102401</id><published>2008-06-02T11:43:00.000-07:00</published><updated>2008-06-02T11:52:34.494-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySql'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='gears'/><title type='text'>Dumping a mysql database - piece of cake</title><content type='html'>&lt;p&gt;
I love MySql.  A lot.  No muss, no fuss.  It just gets the job done.  Granted I am not supporting it on an enterprise level (as the argument usually goes from the pro-proprietary), but it really fits my needs great.  
&lt;/p&gt;&lt;p&gt;
Case in point: I had a prototype project hosted on some hardware that was incurring cost.  Being that the prototype had outlived it's usefulness I wanted to back up my code but then un-host it and get rid of the hardware.  Since the project was quite simple, I had done the MySql DB work myself (I'm usually a java developer but I was DB admin as well on this LAMP project).  Now it came time to back up the database.
&lt;/p&gt;&lt;p&gt;
I googled for backing up a MySql database and found &lt;a href="http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/"&gt;this&lt;/a&gt;.  It simply outlines the utility included with MySql that accomplishes my purpose.  I ran a simple:
&lt;/p&gt;
&lt;div class="code"&gt;
mysqldump -u root -p Complaints &gt; complaints.sql
&lt;/div&gt;
&lt;p&gt;
Bam!  All done!  5 minutes tops.  Data and structure backed up and ready to be re-instantiated at my bidding.  Hence, I love MySql.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-672566280467102401?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/672566280467102401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=672566280467102401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/672566280467102401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/672566280467102401'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2008/06/dumping-mysql-database-piece-of-cake.html' title='Dumping a mysql database - piece of cake'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-8162933035243029534</id><published>2008-03-25T07:37:00.000-07:00</published><updated>2008-03-25T07:59:17.308-07:00</updated><title type='text'>Database operation failed. ERROR: library routine called out of sequence DETAILS: not an error</title><content type='html'>&lt;p&gt;I ran into this guy "Database operation failed. ERROR: library routine called out of sequence DETAILS: not an error" while working on a google gears application.  The error comes from SQL Lite (the technology under the sheets of gears' data store).  There didn't seem to be much documentation on the web to help but finally from placing lots of alert statements (don't you love javascript?) I narrowed it down to a call to rs.next().  I knew the data set would be empty so I immediately suspected I was doing something wrong with checking for the end of the RS.
&lt;p&gt;My suspicions were confirmed when I found the following code block at &lt;a href="http://code.google.com/apis/gears/api_database.html#ResultSet"&gt;http://code.google.com/apis/gears/api_database.html#ResultSet&lt;/a&gt;:
&lt;br&gt;
&lt;div class="code"&gt;
while (rs.isValidRow()) {
  console.log(rs.fieldName(0) + " == " + rs.field(0));
  rs.next();
}
rs.close();
&lt;/div&gt;
&lt;p&gt;It appears I missed something basic.  Unlike both Oracle and MySQL, when grabbing a new row in SQL Lite in Gears there isn't any automatic evaluation that the row is valid.  You have to explicitly call the isValidRow() method.  This leaves out the nice and tidy while(rs.next) loops that we all love so much.  The first row comes pre-loaded then you have to next after each use.  As the dude would say "That's a bummer, Man."  I hope I head off someone else freaking out over this novice problem when working in Gears.  Maybe SQL Lite/Gears will eliminate the need for the call some day, until then...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-8162933035243029534?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/8162933035243029534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=8162933035243029534' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/8162933035243029534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/8162933035243029534'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2008/03/database-operation-failed-error-library.html' title='Database operation failed. ERROR: library routine called out of sequence DETAILS: not an error'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-5339712494469629841</id><published>2008-03-01T05:35:00.000-08:00</published><updated>2008-03-01T05:48:16.929-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='js'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='offline'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='gears'/><title type='text'>Google answers online state dilemma with non-answer</title><content type='html'>&lt;p&gt;As I discussed in &lt;a href="http://bustedmug.blogspot.com/2008/03/google-gears-and-online-state-dilemma.html"&gt;my previous post&lt;/a&gt; There isn't a way to maintain online state with &lt;a href="http://gears.google.com/index2.html"&gt;Google Gears&lt;/a&gt;.  I just found &lt;a href="http://code.google.com/support/bin/answer.py?answer=82722&amp;topic=11692"&gt;an entry on Google Code&lt;/a&gt; which addresses the subject when it comes to database stores.  I totally understand Google's point about wanting developers to ensure synchs are reliable and not assume online = success.  That still doesn't address my issue with LocalServer rather than the Database module of Gears. &lt;/p&gt;

&lt;p&gt;A bit frustrating also is to see that on the same page Google provides essentially the same code I discussed previously to ping the server with AJAX to verify that it is available.  GaH!  Wasted effort!&lt;/p&gt;

&lt;p&gt;I have to say that I do think Google is cutting off it's nose to spite it's face here.  While an isOnline() function might be abused when it comes to the local database, it's entirely necessary (as I've demonstrated) for the localServer which is 1/3 of the gears trinity.  In addition, I've seen time and time again that you can't use technology to make programmers do their job correctly (I've tried).  You have to empower them to make good design decisions on their own, warn them of the pitfalls, and then let them deal with the consequences if they don't do their job well.  It's an annoying fact of life in IT (I would know, I've done a lot of cleanup after bad programmers).  That's my 2 cents anyhow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-5339712494469629841?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/5339712494469629841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=5339712494469629841' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/5339712494469629841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/5339712494469629841'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2008/03/google-answers-online-state-dilemma.html' title='Google answers online state dilemma with non-answer'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-7990654753521522644</id><published>2008-03-01T05:10:00.000-08:00</published><updated>2008-03-01T05:29:49.025-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='js'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='offline'/><category scheme='http://www.blogger.com/atom/ns#' term='ecma'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='gears'/><title type='text'>Google gears and the online state dilemma</title><content type='html'>&lt;p&gt;As I mentioned in my previous post I've been working with &lt;a href="http://gears.google.com/index2.html"&gt;Google Gears&lt;/a&gt; as of late.  Being a greenhorn to this technology (as nearly everyone is since it's pretty new) I found myself considering some fairly serious design questions.  The most interesting was "how do I tell if a user is in offline mode (pages and data cached) but has the ability to switch over to online mode?"&lt;/p&gt;

&lt;p&gt;Now of course whenever you talk about "modes" in an application it is natural to think about a state machine.  That gets a little dicier with the new paradigm introduced with Gears.  Since gears runs purely in javascript with a little interaction with the browser plugin, I decided that making an AJAX request for a file that doesn't get cached (as defined in my gears manifest file) was best.  If I got the proper contents of that file then I knew the person could swap to online mode, if not then I know they aren't connected.  Simple right?&lt;/p&gt;

&lt;p&gt;So I thought.  Once I whipped up my code I could offline and online my pc and the app was stateful, except of course for a little lag that the ajax request took to timeout when it wasn't ever going to get a response from the server.  I included validation based on state to see if I would let the user remove their cached pages and get the online one and everything was happy.&lt;/p&gt;

&lt;p&gt;Then I decided to take a look at what I'd done pretending to be a non-technical user.  I offlined my app and then watched it.  During the lag I noticed that the app state was still online (meaning you could validly switch to online mode) because the first AJAX request hadn't failed yet.  So I thought to myself "what if the user took this literally and assumed they were connected via wifi or something and tried to go online?"&lt;/p&gt;  

&lt;p&gt;The answer: DEATH.  Ok not really death but my state machine happily checked its state, saw that it was online, removed all the cached pages and tried to get at the online version of the page.  This of course resulted in a 404 as the user wasn't actually connected.  No good.  My first instinct was that I had to prevent this from ever being a possible scenario because a user would probably freak out.&lt;/p&gt;

&lt;p&gt;The half-measure I took to do this was to break out the cache-removing code and not include it on the manifest.  Now the user can attempt to remove their cache, but if they aren't actually online they won't find that page and get a 404, but they can back up and the app is still happily serving up cached content while they continue to be offline.&lt;/p&gt;

&lt;p&gt;I'm happy with this but not completely.  It seems to me (at least so far) that there's no way to conquer this part of the paradigm shift that gears introduces into web applications.  No matter how you code around it, the web layer always has a degree of latency associated with it that will allow a window for 404 messages.  I hate for the user to see that.  I'll update if I figure out a way around this loophole, please comment if you know one ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-7990654753521522644?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/7990654753521522644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=7990654753521522644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/7990654753521522644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/7990654753521522644'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2008/03/google-gears-and-online-state-dilemma.html' title='Google gears and the online state dilemma'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-1743306921950567104</id><published>2008-03-01T04:49:00.000-08:00</published><updated>2008-03-01T05:08:51.738-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='forking'/><category scheme='http://www.blogger.com/atom/ns#' term='offline'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='gears'/><category scheme='http://www.blogger.com/atom/ns#' term='threading'/><title type='text'>Simple, cross-browser threading (forking) in php</title><content type='html'>&lt;p&gt;I recently had a need to do some threaded processing in php while working on a &lt;a href="http://gears.google.com/index2.html"&gt;Google Gears&lt;/a&gt; prototype application.  As is often the case with gears, when synching the data with the online database, it'll take a while.  If you're doing this explicitly and not in the background, it's nice to at least be able to update the user of the process' status using AJAX.  This was my need for threading (forking in php).  I wanted to run a thread to handle the update of the database and let the user sit on a page that keeps checking on the progress and updating a progress bar.  Intuitive, right?&lt;/p&gt;

&lt;p&gt;Since it had been a while since I've worked with forks in PHP I figured I'd check out Google for a tutorial on the best practice on the subject.  Whoa.  I got like 90 different methodologies and hardly any worked for all scenarios and cross-platform (I don't know if my project will end up on a server with windows under it or *nix).  That is, until I found &lt;a href="http://www.djkaty.com/drupal/php/fork"&gt;this blog entry by a chick named Katy&lt;/a&gt;.  She demos the following code:&lt;/p&gt;
&lt;br/&gt;&lt;br/&gt;
To create a fork:
&lt;div class='code'&gt;&lt;pre&gt;
function startFork($path, $file, $args)
{
  chdir($path);

  if (substr(PHP_OS, 0, 3) == 'WIN')
    $proc = popen('start /b php "' . $path . '\\' . $file . '" ' . $args, 'r');
  else
    $proc = popen('php ' . $path . '/' . $file . ' ' . $args . ' &amp;', 'r');
 
  return $proc;
}
&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;
To get data from the fork:
&lt;div class='code'&gt;&lt;pre&gt;
while (!feof($proc)) {
  $data = fgets($proc);

  // Do something with the data
}&lt;/pre&gt;
&lt;/div&gt;


This methodology is great because it seems to always fit.  It's pretty easy to understand too.  It does involve some OS calls but has conditions for for windows and *nix, which is ok by me.  It's a simple method that starts a new process for the thread.  I plan to implement post haste.  I'd recommend this if you need to do some threading (forking, I wish Java and PHP would get on the same page as far as terminology is concerned).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-1743306921950567104?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/1743306921950567104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=1743306921950567104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/1743306921950567104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/1743306921950567104'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2008/03/simple-cross-browser-threading-forking.html' title='Simple, cross-browser threading (forking) in php'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-6540215151460634083</id><published>2007-11-15T07:32:00.000-08:00</published><updated>2007-11-15T07:50:28.144-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='js'/><category scheme='http://www.blogger.com/atom/ns#' term='ecma'/><category scheme='http://www.blogger.com/atom/ns#' term='w3c'/><category scheme='http://www.blogger.com/atom/ns#' term='dom'/><category scheme='http://www.blogger.com/atom/ns#' term='id'/><category scheme='http://www.blogger.com/atom/ns#' term='name'/><title type='text'>IE duplicates element IDs into the Name attribute, which screwed me up!</title><content type='html'>&lt;p&gt;ARGH!  This one really gets me steamed.  It seems that IE has decided that rather than supporting the applicable W3C and ECMA standards, they do what made sense to them.  Surprised?  I'm not.  Anyhow, what the world ends up being stuck with is a scenario where id attributes are mirrored into an invisible name attribute for form elements.  Why?  So some lazy javascript developer somewhere can erroneously use getElementById('x') to access an element that has the NAME "x" but no the ID "x".  I'll spare you the departure into the fact that the frigging function says ID in it and there's another one that uses NAME explicitly.  Such mastery of scripting is apparently too much to ask. &lt;/p&gt;
&lt;p&gt;That on it's own is lazy, but not terrible.  However it turns terrible when you've got some code like this:
&lt;div class="code"&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;td&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;id&lt;/font&gt;&lt;font color='blue'&gt;="range5"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;input&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;type&lt;/font&gt;&lt;font color='blue'&gt;="text"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;name&lt;/font&gt;&lt;font color='blue'&gt;="range5"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;/&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;td&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;p&gt;Now when you submit some perfectly reasonable HTML like this to a web server with a decent browser like firefox you get only 1 element named range5 as you'd expect because you only named one element range5.  Try the same with IE and what you'll end up with is a few hours of debugging and cursing the MSoft name.  At the end of said debugging you'll find that since IE mirrors the ID attribute into the name attribute (invisibly) The server actually is submitted 2 elements named range5, the first of which in this case has a null value.  ARRRRRGH!&lt;/p&gt;
&lt;p&gt;So then what is the world left to do about such idiocracy (excellent movie by the by, look it up)?  Well, I for one am going to dutifully note this in my "things that suck about IE to think about when coding" list that I always have running around in my head, and not name any IDs the same as NAMEs even though those are supposed to be two distinct entities with no relationship what so ever. IE sucks.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-6540215151460634083?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/6540215151460634083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=6540215151460634083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/6540215151460634083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/6540215151460634083'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/11/ie-duplicates-element-ids-into-name.html' title='IE duplicates element IDs into the Name attribute, which screwed me up!'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-7981631774676018451</id><published>2007-11-07T08:43:00.000-08:00</published><updated>2007-11-15T07:51:35.134-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='multi-lingual'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='i18n'/><title type='text'>AJAX and multi-lingual apps (i18n)</title><content type='html'>I found a great list of &lt;a href="http://swik.net/Ajax/Ajax+Mistakes"&gt;AJAX mistakes (http://swik.net/Ajax/Ajax+Mistakes&lt;/a&gt;) in the course of making one.  When dealing with mutli-lingual apps you need to use the UTF-8 char set as it provides umlauts and tilde's for spanish and german (just to name a few).  The obvious implementation is to set this on your HTML response.  The easy part to miss though is to set them in ajax as Ajax Mistakes points out:
&lt;blockquote&gt;&lt;h3&gt;Character Sets&lt;/h3&gt;

One big problem with using AJAX is the lack of support for character sets. You should always set the content character set on the server-side as well as encoding any data sent by Javascript. Use ISO-8859-1 if you use plain english, or UTF-8 if you use special characters, like æ, ø and å (danish special characters) Note: it is usually a good idea to go with utf-8 nowadays as it supports many languages).&lt;/blockquote&gt;

As it turned out I needed to set the content type of my response to include the UTF-8 character set like so:
&lt;div class="code"&gt;
response.setContentType("text/html; charset=utf-8");
&lt;/div&gt;

Then my AJAX response came through with valid characters, yay!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-7981631774676018451?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/7981631774676018451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=7981631774676018451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/7981631774676018451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/7981631774676018451'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/11/ajax-and-multi-lingual-apps-i18n.html' title='AJAX and multi-lingual apps (i18n)'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-6823269478151242292</id><published>2007-03-19T06:54:00.000-07:00</published><updated>2007-03-19T06:54:40.942-07:00</updated><title type='text'>Busted Mug: Dynamic Assignment of Event Handlers - A generic rollover event</title><content type='html'>&lt;a href="http://bustedmug.blogspot.com/2007/03/dynamic-assignment-of-event-handlers.html"&gt;Busted Mug: Dynamic Assignment of Event Handlers - A generic rollover event&lt;/a&gt; - Gosh, what was I thinking?  You've gotta preload those rollovers!  Here's a revised version using a dynamically created function as the dynamically created event handler.  Say that ten times fast...you'll probably want to dynamically go create yourself a cup of coffee ;)

&lt;div class='code'&gt;
//bch:&amp;nbsp;better&amp;nbsp;code&amp;nbsp;for&amp;nbsp;rollovers&lt;br /&gt;
function&amp;nbsp;start(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;els&amp;nbsp;=&amp;nbsp;document.getElementsByTagName('img');&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;(i=0;&amp;nbsp;i&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;els.length;&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;i++){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(els[i].className&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;==&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;"rollover"){&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;tmp&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;new&amp;nbsp;Image();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//save&amp;nbsp;out&amp;nbsp;source&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmp.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;els[i].src;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outs[i]&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;tmp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//save&amp;nbsp;over&amp;nbsp;source&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmp.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;els[i].substring(0,src.length-4)&amp;nbsp;+&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;"_over"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;+&amp;nbsp;src.substring(src.length-4);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;overs[i]&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;tmp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//set&amp;nbsp;event&amp;nbsp;handlers&amp;nbsp;w/&amp;nbsp;dynamic&amp;nbsp;functions&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;els[i].onmouseover&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;eval(new&amp;nbsp;function&amp;nbsp;(){&amp;nbsp;this.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;overs[i].src});&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;els[i].onmouseout&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;eval(new&amp;nbsp;function&amp;nbsp;(){&amp;nbsp;this.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;outs[i].src});&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;/font&gt;
 &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-6823269478151242292?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/6823269478151242292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=6823269478151242292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/6823269478151242292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/6823269478151242292'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/03/busted-mug-dynamic-assignment-of-event.html' title='Busted Mug: Dynamic Assignment of Event Handlers - A generic rollover event'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-2935025040819145854</id><published>2007-03-16T10:55:00.000-07:00</published><updated>2007-03-16T10:59:46.475-07:00</updated><title type='text'>Double killer delete select all</title><content type='html'>&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://www.youtube.com/v/2Y_Jp6PxsSQ"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/2Y_Jp6PxsSQ" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;br /&gt;
Oh it burns so good! It reminds me of this classic windows 98 debachle
&lt;br /&gt;
&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://www.youtube.com/v/lccT1ZM5soA"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/lccT1ZM5soA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-2935025040819145854?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/2935025040819145854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=2935025040819145854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/2935025040819145854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/2935025040819145854'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/03/double-killer-delete-select-all.html' title='Double killer delete select all'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-600238390324728483</id><published>2007-03-16T08:53:00.000-07:00</published><updated>2007-03-16T08:53:39.497-07:00</updated><title type='text'>Mystery white space before a table</title><content type='html'>&lt;p&gt;I was trying to debug some mystery white space that was appearing on a page before a table.  For some reason the source code showed nothing before the table, but the display didn't agree.&lt;/p&gt;

&lt;p&gt;Using FireBug (an add-on to firefox that i HIGHLY recommend) I was able to see that FFox thought that white  space should be there because of some BR tags.  Curious.  I couldn't find them anywhere.&lt;/p&gt;

&lt;p&gt;Finally tracing through I ran into a much more obfuscated version of this:&lt;/p&gt;

&lt;div class='code'&gt;
&lt;font color='blue'&gt;out&lt;/font&gt;&lt;font color='black'&gt;.println(&lt;/font&gt;&lt;font color='#808080'&gt;"&amp;lt;table&amp;gt;"&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
for&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;(&lt;/font&gt;&lt;font color='blue'&gt;int&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='maroon'&gt;0&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i&amp;lt;contents.length&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i++){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;out&lt;/font&gt;&lt;font color='black'&gt;.println(&lt;/font&gt;&lt;font color='#808080'&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;"&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;+&amp;nbsp;contents[i]&amp;nbsp;+&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;br&amp;gt;"&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;/font&gt;&lt;font color='black'&gt;}&lt;/font&gt;
 &lt;/div&gt;

&lt;p&gt;Note the BR on the end there.  That's not valid.  Apparently FFox handled this bad code by kicking the BRs to the head of the table.  A simple fix to a problem that had me in mug busting mood BIG TIME.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-600238390324728483?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/600238390324728483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=600238390324728483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/600238390324728483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/600238390324728483'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/03/mystery-white-space-before-table.html' title='Mystery white space before a table'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-2174169859339658337</id><published>2007-03-05T09:27:00.000-08:00</published><updated>2007-03-19T07:05:20.414-07:00</updated><title type='text'>Dynamic Assignment of Event Handlers - A generic rollover event</title><content type='html'>Rollovers are so often done badly and you have to write code for every image.  No more.  It is much better to use some code as follows to make a generic function and then apply it generically as I have using the class attribute.
&lt;br&gt;&lt;br&gt;
 &lt;div class='code'&gt;
&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;html&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;head&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;start(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;els&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;document&lt;/font&gt;&lt;font color='black'&gt;.getElementsByTagName(&lt;/font&gt;&lt;font color='#808080'&gt;'img'&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;(i&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='maroon'&gt;0&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i&amp;lt;els.length&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i++){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&lt;/font&gt;&lt;font color='black'&gt;(els[i].className&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"rollover"&lt;/font&gt;&lt;font color='black'&gt;){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;els[i].onmouseover&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;swap&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;els[i].onmouseout&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;swap&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;swap(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;this&lt;/font&gt;&lt;font color='black'&gt;.src&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;pos&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;this&lt;/font&gt;&lt;font color='black'&gt;.src.indexOf(&lt;/font&gt;&lt;font color='#808080'&gt;"_over"&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;tmp&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;new&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;Image()&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/font&gt;&lt;font color='black'&gt;(pos&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;-&lt;/font&gt;&lt;font color='maroon'&gt;1&lt;/font&gt;&lt;font color='black'&gt;){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmp.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;src.substring(&lt;/font&gt;&lt;font color='maroon'&gt;0&lt;/font&gt;&lt;font color='black'&gt;,src.length-&lt;/font&gt;&lt;font color='maroon'&gt;4&lt;/font&gt;&lt;font color='black'&gt;)&amp;nbsp;+&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"_over"&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;+&amp;nbsp;src.substring(src.length-&lt;/font&gt;&lt;font color='maroon'&gt;4&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this&lt;/font&gt;&lt;font color='black'&gt;.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;tmp.src&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;/font&gt;&lt;font color='blue'&gt;else&lt;/font&gt;&lt;font color='black'&gt;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;this&lt;/font&gt;&lt;font color='black'&gt;.src&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;src.substring(&lt;/font&gt;&lt;font color='maroon'&gt;0&lt;/font&gt;&lt;font color='black'&gt;,pos)&amp;nbsp;+&amp;nbsp;src.substring(pos+5)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;head&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;body&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onload&lt;/font&gt;&lt;font color='blue'&gt;="start();"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;img&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;src&lt;/font&gt;&lt;font color='blue'&gt;="x.gif"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;id&lt;/font&gt;&lt;font color='blue'&gt;="hi"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;class&lt;/font&gt;&lt;font color='blue'&gt;="rollover"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;/&gt;&lt;br /&gt;
&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;body&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;html&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;
 &lt;/div&gt;
&lt;p&gt;Doh! Be sure to read &lt;a href="http://bustedmug.blogspot.com/2007/03/dynamic-assignment-of-event-handlers.html"&gt; the update&lt;/a&gt; to this post, too. I forgot to preload those images :x&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-2174169859339658337?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/2174169859339658337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/2174169859339658337'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/03/dynamic-assignment-of-event-handlers.html' title='Dynamic Assignment of Event Handlers - A generic rollover event'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-8545942667419175303</id><published>2007-03-02T07:19:00.000-08:00</published><updated>2007-03-02T07:34:25.284-08:00</updated><title type='text'>The External JavaScript File (.JS) Caching Dilemma</title><content type='html'>The apps I work on always seem to run into issues because users have cached old versions of our external javascript files.  I'll add a call to a new function defined in a .js to a page and the user's browser will puke because it is using the cached version.  No good.
&lt;br&gt;&lt;br&gt;
While looking for a way to prevent my .js files from being cached I ran across this: &lt;a href="http://www.divinentd.com/2005/08/preventing-javascript-file-caching.html"&gt;DivineNTD.com Journal: Preventing JavaScript File Caching&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
That doesn't really solve the problem since you're just changing source, but I'll take it.  It will keep your .js file at the newest version.  Dirty, but effective.
&lt;br&gt;&lt;br&gt;
To push the solution forward a little, what I've decided to do is to add a member to a static class that is loaded in the constructor.  I then create one of these when the app is started.  Since I am working in Java and it is compiled, the app will be restarted when new code is introduced.  This means that whenever the app is restarted, the date changes.   I append THAT, after a ? to my .js addresses and voila: .js files are flushed out of the cache only when they are changed.  ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-8545942667419175303?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/8545942667419175303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=8545942667419175303' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/8545942667419175303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/8545942667419175303'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/03/divinentdcom-journal-preventing.html' title='The External JavaScript File (.JS) Caching Dilemma'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-5998203993865050665</id><published>2007-02-07T11:40:00.000-08:00</published><updated>2007-02-07T11:40:38.654-08:00</updated><title type='text'>Error: uncaught exception: Permission denied to call method XMLHttpRequest.open</title><content type='html'>&lt;a href="http://www.captain.at/howto-ajax-permission-denied-xmlhttprequest.php"&gt;Error: uncaught exception: Permission denied to call method XMLHttpRequest.open&lt;/a&gt;: &lt;blockquote&gt;"
If the page with the XMLHttpRequest is on a http:// URI (on a webserver), it is not possible to fetch data from another domain!!! This is a security measure of Mozilla/Firefox.
Still, it comes in handy, if you can read remote data from a local application. E.g. you've got a local XUL application that needs to get data from other servers - Dude! Sweet! :-)"&lt;/blockquote&gt;

The bane of my web 2.0 existance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-5998203993865050665?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/5998203993865050665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=5998203993865050665' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/5998203993865050665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/5998203993865050665'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/02/error-uncaught-exception-permission.html' title='Error: uncaught exception: Permission denied to call method XMLHttpRequest.open'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-6300588403964029163</id><published>2007-01-25T13:56:00.000-08:00</published><updated>2007-01-25T14:15:35.495-08:00</updated><title type='text'>OnBeforeUnload, IE7, Assigning event handlers to null and the problems that arise</title><content type='html'>This IE7 issue almost totally screwed me at work.  Image if a JS designed to keep users from leaving a page before placing their order suddenly started telling all users that they were leaving and their orders weren't being placed, even though they were.  Ouch.. that'd probably have someone gunning for my job.  But that almost happened.  Here's how MSoft and sucky IE7 almost did it to me:

I had a script like this.
&lt;div class='code'&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;window&lt;/font&gt;&lt;font color='black'&gt;.onbeforeunload&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;confirmExit&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;confirmExit()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"Leaving&amp;nbsp;this&amp;nbsp;page&amp;nbsp;will&amp;nbsp;cause&amp;nbsp;all&amp;nbsp;unplaced&amp;nbsp;orders&amp;nbsp;to&amp;nbsp;be&amp;nbsp;discarded.&amp;nbsp;&amp;nbsp;Are&amp;nbsp;you&amp;nbsp;sure&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;leave&amp;nbsp;the&amp;nbsp;page?"&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;input&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;type&lt;/font&gt;&lt;font color='blue'&gt;="image"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;src&lt;/font&gt;&lt;font color='blue'&gt;="/lgrequest.gif"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onclick&lt;/font&gt;&lt;font color='blue'&gt;="javascript:&amp;nbsp;window.onbeforeunload&amp;nbsp;=&amp;nbsp;null;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.forms[0].submit();"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;/&gt;&lt;/font&gt;
 &lt;/div&gt;

Apparently IE7 doesn't like the part where I set onBeforeUnload = null;  SO it just ignored that.  The result would have been disaster but for a stroke to testing luck.  Here's the simple yet crucial change that I made:

 &lt;div class='code'&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;goodExit&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window&lt;/font&gt;&lt;font color='black'&gt;.onbeforeunload&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;confirmExit&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;confirmExit()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;(!goodExit)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;return&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"Leaving&amp;nbsp;this&amp;nbsp;page&amp;nbsp;will&amp;nbsp;cause&amp;nbsp;all&amp;nbsp;unplaced&amp;nbsp;orders&amp;nbsp;to&amp;nbsp;be&amp;nbsp;discarded.&amp;nbsp;&amp;nbsp;Are&amp;nbsp;you&amp;nbsp;sure&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;leave&amp;nbsp;the&amp;nbsp;page?"&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;nbsp;.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;input&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;type&lt;/font&gt;&lt;font color='blue'&gt;="image"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;src&lt;/font&gt;&lt;font color='blue'&gt;="&amp;lt;%=AppService.BASEDIR%&amp;gt;/images/lgrequest.gif"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onclick&lt;/font&gt;&lt;font color='blue'&gt;="javascript:&amp;nbsp;goodExit&amp;nbsp;=&amp;nbsp;true;&amp;nbsp;window.onbeforeunload&amp;nbsp;=&amp;nbsp;null;&amp;nbsp;document.forms[0].submit();"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;/&gt;&lt;/font&gt;
 &lt;/div&gt; 
I know I have mentioned it before but IE7 sucks!  I use it at work and I must admit the new tab interface works nicely, but all the crap they changed makes me say "IE7 SUCKS"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-6300588403964029163?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/6300588403964029163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=6300588403964029163' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/6300588403964029163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/6300588403964029163'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/onbeforeunload-ie7-assigning-event.html' title='OnBeforeUnload, IE7, Assigning event handlers to null and the problems that arise'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116907103384364783</id><published>2007-01-17T13:57:00.000-08:00</published><updated>2007-01-17T13:57:14.166-08:00</updated><title type='text'>Disable Just-in-time debugging after installing IE developer toolbar</title><content type='html'>&lt;p&gt;If you are now stuck with a window that opens asking if you'd like to debug the current page after every page load, you're I am, or was.  I was pulling my hair out over that stupid box forever because I couldn't figure out how to shut the danged thing off.  It turned itself on WITHOUT ASKING when I installed the IE7 developer toolbar.  It didn't bother me too too much because I hate IE7 anyway :)

&lt;p&gt;So I finally came upon the fix today.  Below is the reference:

&lt;p&gt;&lt;a href="http://www.feedreader.com/node/681"&gt;Life Hacker--Just in Time Debugging? | What is RSS Feedreader? | Feedreader - Totally Free RSS / ATOM Newsreader / Aggregator&lt;/a&gt;

&lt;p&gt;Basically go (in IE, not the toolbar b/c that would make sense) to tools&gt;internet options&gt;advanced and uncheck the debug scripts boxes (there are two types).  Then you're pop-up free.  Yay!  This is why I hate you, MS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116907103384364783?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116907103384364783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116907103384364783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116907103384364783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116907103384364783'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/disable-just-in-time-debugging-after.html' title='Disable Just-in-time debugging after installing IE developer toolbar'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116863225958006593</id><published>2007-01-12T12:04:00.000-08:00</published><updated>2007-01-12T12:33:28.656-08:00</updated><title type='text'>IE7 SUCKS</title><content type='html'>&lt;p&gt;I was recently forced to download IE7.  It sucks.  IE7 sucks.  Ok, now I've done my part.  I truly don't like IE7 at all (the interface is really crappy and it messes with relative image paths) and apparently the world agrees.  Check out this article: &lt;a href="http://www.marketingpilgrim.com/2006/02/microsoft-ie-70-sucks.html"&gt;Microsoft Internet Explorer (IE) 7.0 Sucks! | Marketing Pilgrim&lt;/a&gt;.  In it there is a study done about the number of people posting "IE7 Sucks" and how there's a massive disapproval of Gates' latest.  That warms my heart ;)

&lt;p&gt;In all seriousness though, I have beef with IE7.  At first glance I couldn't even use it.  I don't know why MSoft likes this interface, but I like to be able to use things.  I can't use this.  It isn't intuitive and I'm a developer!  My guess is that it is designed this was to match the new office which &lt;i&gt;supposedly&lt;/i&gt; has made leaps and bounds in usability by re-orging their menus and using pictures.  That remains to be seen in my book, but if they have figured out an easy to use interface, they didn't share the whole story with the IE team because their version stinks.

&lt;p&gt;Also, this anti-phishing stuff is for the birds.  Since when is MSoft the authority on who is worthy of trust and not breaking the law?  Ha ha right right you got me, since they started enforcing copyright laws on their own.  Really though, I'm not comfortable with that.

&lt;p&gt;Anyhow, when it comes to the browser wars, Ffox is still winning me over.  Opera is good and I really like the interface.  It is much neater and cleaner than the competition.  I'm all about adhering to standards too.  However until someone else will spell check the post I'm writing right now as I type it like Ffox does, they're my default browser ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116863225958006593?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116863225958006593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116863225958006593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116863225958006593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116863225958006593'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/ie7-sucks.html' title='IE7 SUCKS'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116843889622459686</id><published>2007-01-10T06:21:00.000-08:00</published><updated>2007-01-10T06:21:36.850-08:00</updated><title type='text'>OnBeforeUnload Event WORKS IN FIREFOX, TOO!!!</title><content type='html'>&lt;p&gt;A page on the MSDN is erroneously spreading the notion that onBeforeUnload is supported only by IE.
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeunload.asp"&gt;onbeforeunload Event (BODY, FRAMESET, window)&lt;/a&gt;
&lt;p&gt;That is totally false.  FireFox has supported onBeforeUnload since version 1.7.  The reason there is beef about this event is that it is not a part of either the W3C spec or the ECMA spec.  However, it has taken on wide support because it provides necessary functionality.  It is used mainly to keep a user from navigating away from a page where they have unsaved input (more for web apps than pages).  
&lt;p&gt;So by all means use onBeforeUnload if you need that kind of functionality as it is likely to be adopted into some standard due to it's far reaching use (even Google does it).  Just be sure that you script something for onUnload for the Opera users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116843889622459686?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116843889622459686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116843889622459686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116843889622459686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116843889622459686'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/onbeforeunload-event-works-in-firefox.html' title='OnBeforeUnload Event WORKS IN FIREFOX, TOO!!!'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116827845415324805</id><published>2007-01-08T09:47:00.000-08:00</published><updated>2007-01-08T09:48:32.506-08:00</updated><title type='text'>XMLHttpRequest is not allowed to other domains in Firefox</title><content type='html'>&lt;a href="http://www.thescripts.com/forum/thread585271.html"&gt;XMLHttpRequest problem with Firefox and Netscape - Javascript / DHTML / Ajax&lt;/a&gt;

&lt;p&gt;TheScripts is yet again my muse.  This post is to a person who ran into exactly the same problem as I myself did my first time working with web services.  The natural desire is to call a bunch of web services to mash up some resources you have available.  This is all well and good until you try to get at resources not found underneath the same domain.

&lt;p&gt;In order to prevent malicious web pages from telling your browser to call all manner of nasty XML resources when you load it up, the good folks at mozilla (and maybe IE now too - I'm not sure) won't let billie.com/home.html call a web service (or ajax or anything) hosted at susie.com/ws/stockticker.xml.  

&lt;p&gt;This keeps us secure but is WAAAAYYYY annoying if you happen to be a developer on billie.com who needs to get at that stock ticker.  What you've got to do is build billie.com/ajax/tickerCaller.xml which just makes a call (on the server side of course) to susie's stock ticker and returns the XML.  

&lt;p&gt;It ain't pretty, but until some new fangled security comes out, that's what we're stuck with.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116827845415324805?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116827845415324805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116827845415324805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116827845415324805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116827845415324805'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/xmlhttprequest-is-not-allowed-to-other.html' title='XMLHttpRequest is not allowed to other domains in Firefox'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116802551310350006</id><published>2007-01-05T11:29:00.000-08:00</published><updated>2007-01-10T14:13:09.600-08:00</updated><title type='text'>The Code from my last post with my new colorizer ;)</title><content type='html'>&lt;div class='code'&gt;
&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;lilPx&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"200px"&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//size&amp;nbsp;of&amp;nbsp;small&amp;nbsp;select&amp;nbsp;box&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;bigPx&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"600px"&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//size&amp;nbsp;of&amp;nbsp;large&amp;nbsp;select&amp;nbsp;box&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;prefix&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;'bs'&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//prefix&amp;nbsp;used&amp;nbsp;on&amp;nbsp;all&amp;nbsp;select&amp;nbsp;box&amp;nbsp;IDs&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;document&lt;/font&gt;&lt;font color='black'&gt;.onmouseover&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;shrinkAll&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//handles&amp;nbsp;abandoned&amp;nbsp;selections&amp;nbsp;(no&amp;nbsp;change)&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;resize(id){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//get&amp;nbsp;the&amp;nbsp;element&amp;nbsp;in&amp;nbsp;question&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;elem&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;document&lt;/font&gt;&lt;font color='black'&gt;.getElementById(id)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//dynamically&amp;nbsp;init/assign&amp;nbsp;the&amp;nbsp;holder&amp;nbsp;variable&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;holder&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;eval&lt;/font&gt;&lt;font color='black'&gt;(&lt;/font&gt;&lt;font color='#808080'&gt;"hold"&lt;/font&gt;&lt;font color='black'&gt;+id)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//if&amp;nbsp;select&amp;nbsp;not&amp;nbsp;being&amp;nbsp;held&amp;nbsp;open&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;(!holder){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//go&amp;nbsp;big-&amp;gt;small&amp;nbsp;or&amp;nbsp;small&amp;nbsp;-&amp;gt;&amp;nbsp;big&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&lt;/font&gt;&lt;font color='black'&gt;(elem.style.width&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;bigPx)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elem.style.width&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;lilPx&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;elem.style.width&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;bigPx&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;/font&gt;&lt;font color='blue'&gt;else&lt;/font&gt;&lt;font color='black'&gt;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elem.style.width&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;bigPx&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;hold(id){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//swap&amp;nbsp;the&amp;nbsp;hold&amp;nbsp;value,&amp;nbsp;dynamic&amp;nbsp;of&amp;nbsp;course&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;eval&lt;/font&gt;&lt;font color='black'&gt;(&lt;/font&gt;&lt;font color='#808080'&gt;"hold"&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;+&amp;nbsp;id&amp;nbsp;+&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"&amp;nbsp;=&amp;nbsp;!hold"&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;+&amp;nbsp;id)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//change&amp;nbsp;size&amp;nbsp;if&amp;nbsp;necessary&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;resize(id)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;shrink(id){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//get&amp;nbsp;element&amp;nbsp;to&amp;nbsp;shrink&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;elem&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;document&lt;/font&gt;&lt;font color='black'&gt;.getElementById(id)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//set&amp;nbsp;width&amp;nbsp;to&amp;nbsp;small&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;elem.style.width&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;lilPx&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//unhold&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;eval&lt;/font&gt;&lt;font color='black'&gt;(&lt;/font&gt;&lt;font color='#808080'&gt;"hold"&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;+&amp;nbsp;id&amp;nbsp;+&amp;nbsp;&lt;/font&gt;&lt;font color='#808080'&gt;"&amp;nbsp;=&amp;nbsp;false"&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;function&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;shrinkAll(e){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//be&amp;nbsp;sure&amp;nbsp;we&amp;nbsp;have&amp;nbsp;the&amp;nbsp;real&amp;nbsp;src,&amp;nbsp;not&amp;nbsp;a&amp;nbsp;bubble&amp;nbsp;or&amp;nbsp;trickle!&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;(!e)&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;e&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;window&lt;/font&gt;&lt;font color='black'&gt;.&lt;/font&gt;&lt;font color='blue'&gt;event;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;target&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;(&lt;/font&gt;&lt;font color='blue'&gt;window&lt;/font&gt;&lt;font color='black'&gt;.&lt;/font&gt;&lt;font color='blue'&gt;event&lt;/font&gt;&lt;font color='black'&gt;)&amp;nbsp;?&amp;nbsp;e.srcElement&amp;nbsp;:&amp;nbsp;e.target&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//shrink&amp;nbsp;em&amp;nbsp;all&amp;nbsp;except&amp;nbsp;that&amp;nbsp;one&amp;nbsp;that&amp;nbsp;was&amp;nbsp;the&amp;nbsp;source&amp;nbsp;(possibly)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;var&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;selects&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;document&lt;/font&gt;&lt;font color='black'&gt;.getElementsByTagName(&lt;/font&gt;&lt;font color='#808080'&gt;'select'&lt;/font&gt;&lt;font color='black'&gt;)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&lt;/font&gt;&lt;font color='black'&gt;(i&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='maroon'&gt;0&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i&amp;lt;selects.length&lt;/font&gt;&lt;font color='blue'&gt;;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;i++){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&lt;/font&gt;&lt;font color='black'&gt;(selects[i].id.substring(&lt;/font&gt;&lt;font color='maroon'&gt;0&lt;/font&gt;&lt;font color='black'&gt;,prefix.length)&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;==&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;prefix){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='darkgreen'&gt;//shrink&amp;nbsp;if&amp;nbsp;it&amp;nbsp;wasn't&amp;nbsp;the&amp;nbsp;source&amp;nbsp;(make&amp;nbsp;sure&amp;nbsp;the&amp;nbsp;src&amp;nbsp;isn't&amp;nbsp;parent&amp;nbsp;for&amp;nbsp;&amp;lt;option&amp;gt;&amp;nbsp;in&amp;nbsp;mozilla)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;if&lt;/font&gt;&lt;font color='black'&gt;(selects[i].id&amp;nbsp;!&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;target.id&amp;nbsp;&amp;&amp;&amp;nbsp;selects[i].id&amp;nbsp;!&lt;/font&gt;&lt;font color='blue'&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;target.parentNode.id&amp;nbsp;){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;shrink(selects[i].id)&lt;/font&gt;&lt;font color='blue'&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='black'&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;/font&gt;
 &lt;/div&gt;
 &lt;hr style='height:1px;background-color:#808080' /&gt;
 &lt;span style='font-family:tahoma;font-size:8pt;color:#808080'&gt;Colorized by: &lt;a style='color:#808080' href='http://www.CarlosAg.net/Tools/CodeColorizer/'&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;

AND 
 &lt;div class='code'&gt;
&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;html&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;head&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;type&lt;/font&gt;&lt;font color='blue'&gt;="text/javascript"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;src&lt;/font&gt;&lt;font color='blue'&gt;="script.js"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;script&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;head&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;body&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onload&lt;/font&gt;&lt;font color='blue'&gt;=""&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;id&lt;/font&gt;&lt;font color='blue'&gt;="body"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;div&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;id&lt;/font&gt;&lt;font color='blue'&gt;="outtie"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;div&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;select&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;style&lt;/font&gt;&lt;font color='blue'&gt;="width:200px;"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;id&lt;/font&gt;&lt;font color='blue'&gt;="bs1"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onmouseover&lt;/font&gt;&lt;font color='blue'&gt;="resize(this.id);"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onclick&lt;/font&gt;&lt;font color='blue'&gt;="hold(this.id);"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onchange&lt;/font&gt;&lt;font color='blue'&gt;="resize(this.id);"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onmouseout&lt;/font&gt;&lt;font color='blue'&gt;="resize(this.id);"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00004546353&amp;nbsp;-&amp;nbsp;MAKROLON&amp;nbsp;TANK&amp;nbsp;TRUCK&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00004567435&amp;nbsp;-&amp;nbsp;500&amp;nbsp;BARRELS&amp;nbsp;OF&amp;nbsp;POLYOL&amp;nbsp;50&amp;nbsp;KG&amp;nbsp;ea&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00056463543&amp;nbsp;-&amp;nbsp;POLYURETHANE&amp;nbsp;BLEND&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00005464354&amp;nbsp;-&amp;nbsp;50%&amp;nbsp;ACID&amp;nbsp;SOLUTION&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00056875343&amp;nbsp;-&amp;nbsp;50&amp;nbsp;PALLETS&amp;nbsp;OF&amp;nbsp;RANDOM&amp;nbsp;CHEMICALS&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;select&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;br&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;/&gt;&lt;br /&gt;
&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;select&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;style&lt;/font&gt;&lt;font color='blue'&gt;="width:200px;"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;id&lt;/font&gt;&lt;font color='blue'&gt;="bs2"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onmouseover&lt;/font&gt;&lt;font color='blue'&gt;="resize(this.id);"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onclick&lt;/font&gt;&lt;font color='blue'&gt;="hold(this.id);"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onchange&lt;/font&gt;&lt;font color='blue'&gt;="resize(this.id);"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;onmouseout&lt;/font&gt;&lt;font color='blue'&gt;="resize(this.id);"&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00004546353&amp;nbsp;-&amp;nbsp;MAKROLON&amp;nbsp;TANK&amp;nbsp;TRUCK&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00004567435&amp;nbsp;-&amp;nbsp;500&amp;nbsp;BARRELS&amp;nbsp;OF&amp;nbsp;POLYOL&amp;nbsp;50&amp;nbsp;KG&amp;nbsp;ea&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00056463543&amp;nbsp;-&amp;nbsp;POLYURETHANE&amp;nbsp;BLEND&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00005464354&amp;nbsp;-&amp;nbsp;50%&amp;nbsp;ACID&amp;nbsp;SOLUTION&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;00056875343&amp;nbsp;-&amp;nbsp;50&amp;nbsp;PALLETS&amp;nbsp;OF&amp;nbsp;RANDOM&amp;nbsp;CHEMICALS&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;option&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;select&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;body&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color='blue'&gt;&amp;lt;/&lt;/font&gt;&lt;font color='maroon'&gt;html&lt;/font&gt;&lt;font color='blue'&gt;&amp;gt;&lt;/font&gt;&lt;font color='black'&gt;&lt;/font&gt;
 &lt;/div&gt;
 &lt;hr style='height:1px;background-color:#808080' /&gt;
 &lt;span style='font-family:tahoma;font-size:8pt;color:#808080'&gt;Colorized by: &lt;a style='color:#808080' href='http://www.CarlosAg.net/Tools/CodeColorizer/'&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116802551310350006?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116802551310350006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116802551310350006' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116802551310350006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116802551310350006'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/code-from-my-last-post-with-my-new.html' title='The Code from my last post with my new colorizer ;)'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116802303755281085</id><published>2007-01-05T10:50:00.000-08:00</published><updated>2007-01-05T11:00:20.243-08:00</updated><title type='text'>&lt;SELECT&gt; options are way too long</title><content type='html'>&lt;a href="http://www.thescripts.com/forum/thread584357.html"&gt;in Select Option entries are cut on the right side if they're too long - Javascript / DHTML / Ajax&lt;/a&gt;

This is another post of mine on TheScripts.  This one is pretty interesting because it is a solution of one of those age-old problems: what the crap are you supposed to do when you have a ton of content in a drop-down.  It looks SUPER ugly if you just stretch it across the whole page.

At first I scoured the web for a way to get the dang lines to wrap.  A few sites I found erroneously pointed to some tard's posting on a forum that said just throw BRs in there.  I looked all over the place in hope that there was a CSS solution but to no avail.  Apparently the HTML select tag can't wrap ever no matter what.  Boooooooo.

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/x/blogger/4611/168/1600/515764/dropdown.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/x/blogger/4611/168/320/251995/dropdown.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;font size="-5"&gt;Above is a screenie.  The top select on each of the two sets is w/ no mouseover, the bottom is when you interact w/ the select.&lt;/font&gt;

Finally, I wrote something of my own.  It won't do wrapping, but it does fix the problem.  I made the select box elastic.  When not in use it is a small little thing with a preview of what the selected option says.  When moused over or clicked it expands long enough to display all of the text, then shrinks back up when you're done with it.  I didn't get really tricky and animate the motion or anything, though that would be neat.  It is just functional at this point.  

The problem got really interesting when I had to deal with event bubble and trickle.  That's such a pain.  I got help from the usual sources - w3schools for reference, quirksmode, Dr. Dailey's page.  I should post a demo but I'm not feeling up to it at the moment.  If you want the src or a demo just comment or snag it from theScripts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116802303755281085?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116802303755281085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116802303755281085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116802303755281085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116802303755281085'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/options-are-way-too-long.html' title='&amp;lt;SELECT&amp;gt; options are way too long'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116785352672066612</id><published>2007-01-03T11:45:00.000-08:00</published><updated>2007-01-03T11:45:27.046-08:00</updated><title type='text'>Most CMS packages are PHP based, why is this? - PHP</title><content type='html'>&lt;a href="http://www.thescripts.com/forum/showthread.php?p=2288719#post2288719"&gt;Most CMS packages are PHP based, why is this? - PHP&lt;/a&gt;

To paraphrase myself (I've taken to posting a lot on theScripts) here's why SO many CMSs seem to be in PHP with a database backend (though the latter seems extremely common sense)

The idea behind CMSs being database driven is because of the following premises: a)If you need a CMS you must have a lot of content to organize and b)Databases are the best way to organize a lot of information so logically it follows that you would use a database to organize all of the information.

The reason PHP is so often used is probably because it is very readable, simple, and well suited for the task. CMSs are not super-technical in nature. I don't mean to put them down because they are good at what they do, but they're a simple tool. You don't need a lot of technical complexity to issue a few queries on the database to get content to the page. That being said, many choose PHP because it is simple, lightweight, and good at doing SQL queries and writing them to a page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116785352672066612?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116785352672066612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116785352672066612' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116785352672066612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116785352672066612'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2007/01/most-cms-packages-are-php-based-why-is.html' title='Most CMS packages are PHP based, why is this? - PHP'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116593811376471476</id><published>2006-12-12T07:41:00.000-08:00</published><updated>2007-01-12T12:18:51.813-08:00</updated><title type='text'>Dynamically assigned onclick event never executed when clicking link - Javascript / DHTML / Ajax</title><content type='html'>I just conquered an issue I was having with a&lt;a href="http://www.thescripts.com/forum/thread575962.html"&gt;dynamically assigned onclick event never executed when clicking a link (click me for details)&lt;/a&gt;.

Essentially what I ended up coming up with and highly recommend to others is that if, for some insane crazy reason inexplicable even by cold Vulcan logic, your dynamically assigned event handler just WON'T go - do something like this:
&lt;div class='code'&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;(var&amp;nbsp;i=0;i&lt;font color='blue'&gt;&amp;lt;&lt;/font&gt;&lt;font color='maroon'&gt;arr.length;i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;a&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;_bsn.DOM.createElement(&lt;/font&gt;&lt;font color='blue'&gt;"div",&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;{&amp;nbsp;bgColor:&lt;/font&gt;&lt;font color='blue'&gt;"white"&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;});&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a.innerHTML&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;"&amp;lt;a&amp;nbsp;href=\"#\"&amp;nbsp;onclick=\"selVal(document.getElementById('"+pointer.fld.id+"'),"+arr[i]+");\"&amp;gt;"+arr[i]+"&amp;lt;/a&amp;gt;";&lt;/font&gt;&lt;font color='red'&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;li&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;=&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;_bsn.DOM.createElement(&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color='blue'&gt;"li",&lt;/font&gt;&lt;font color='red'&gt;&amp;nbsp;{},&amp;nbsp;a&amp;nbsp;&amp;nbsp;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ul.appendChild(&amp;nbsp;&amp;nbsp;li&amp;nbsp;&amp;nbsp;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;
 &lt;/div&gt;
 &lt;hr style='height:1px;background-color:#808080' /&gt;
 &lt;span style='font-family:tahoma;font-size:8pt;color:#808080'&gt;Colorized by: &lt;a style='color:#808080' href='http://www.CarlosAg.net/Tools/CodeColorizer/'&gt;CarlosAg.CodeColorizer&lt;/a&gt;&lt;/span&gt;

That is to say, write out a div and fill the innerHTML (even though that a little off standard ;( )  with the element and explicitly write out the event handler.  Then it will take for sure.  Though that seems kinda common sense to me looking back on it, many hours of eye strain when into coming to that solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116593811376471476?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116593811376471476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116593811376471476' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116593811376471476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116593811376471476'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/dynamically-assigned-oncli_116593811376471476.html' title='Dynamically assigned onclick event never executed when clicking link - Javascript / DHTML / Ajax'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116585546890570638</id><published>2006-12-11T08:21:00.000-08:00</published><updated>2006-12-11T08:49:56.463-08:00</updated><title type='text'>IE Select z-index bug (w/select-free layer and autosuggest)</title><content type='html'>Recently I ran into one of the biggest nasties I've ever seen.  It is in IE (fixed in 7 thankfully).  When you've got any element over a select box, the select box breaks through and shows on the top.  It is a real bugger to fix.  &lt;a href="http://www.brainjar.com/css/positioning/default5.asp"&gt;This page&lt;/a&gt; INCORRECTLY throws in the towel and says you can't fix it so just alter your design.  To it's credit, it does sum up the problem pretty well and has a nice pic:
&lt;img src="http://www.brainjar.com/css/positioning/graphics/ie5.5.gif" style="float:right;" /&gt;
I ran into this while implementing &lt;a href="http://www.brandspankingnew.net/archive/2006/08/ajax_auto-suggest_auto-complete.html"&gt;Autosuggest&lt;/a&gt; which I think is a great UI add-on.  However, you'll run into issues when you autosuggest overtop of a select.  No good.

The solution to the select popping over is called &lt;a href="http://www.hedgerwow.com/360/bugs/css-select-free.html"&gt;Select-free layer&lt;/a&gt;.  It is very interesting.  Don't be confusing by the dragginess of their example.  All it does is filter a hidden iframe though to cover any selects, since an iframe doesn't suffer the bug (unless you have selects on that, then heaven help you).  In a nutshell they use this css:
&lt;blockquote&gt;&amp;lt;style&amp;gt;

.select-free
{
 position:absolute;
 z-index:10;/*any value*/
 overflow:hidden;/*must have*/
 width:33em;/*must have for any value*/;
}
.select-free iframe
{
 display:none;/*sorry for IE5*/
 display/**/:block;/*sorry for IE5*/
 position:absolute;/*must have*/
 top:0;/*must have*/
 left:0;/*must have*/
 z-index:-1;/*must have*/
 filter:mask();/*must have*/
 width:3000px;/*must have for any big value*/
 height:3000px/*must have for any big value*/;
}

.select-free .bd{border:solid 1px #aaaaaa;padding:12px;}
&amp;lt;/style&amp;gt;

&amp;lt;div class="select-free" id="dd3"&amp;gt;&amp;lt;div class="bd"&amp;gt;
your content here
&amp;lt;/div&amp;gt;&amp;lt;!--[if lte IE 6.5]&amp;gt;&amp;lt;iframe&amp;gt;&amp;lt;/iframe&amp;gt;&amp;lt;![endif]--&amp;gt;&amp;lt;/div&amp;gt;&lt;/blockquote&gt;
I had the agonizing task of integrating this with autosuggest.  It isn't fun.  Some css had to be changed:
&lt;blockquote&gt;
&amp;lt;style type="text/css"&amp;gt;
 /* 
 ===========================
 styling for autosuggest
 ===========================
 */
 
 .autosuggest{
  position:absolute;
  z-index:10;/*any value*/
  overflow:hidden;/*must have*/
  width:100px;/*must have for any value*/;
 }
 
 .autosuggest .bd{border:solid 0px #aaaaaa;padding:0px;}
 
 .autosuggest #mask{
  border: 0px;
    margin: 0px;
  display:none;/*sorry for IE5*/
  display/**/:block;/*sorry for IE5*/
  position:absolute;/*must have*/
  top:0;/*must have*/
  left:0;/*must have*/
  z-index:-1;/*must have*/
  filter:mask();/*must have*/
  width:3000px;/*must have for any big value*/
  height:3000px/*must have for any big value*/;
 }

 ul.autosuggest
 {
  //position: absolute;
  list-style: none;
  margin: 0;
  padding: 0;
  //overflow-y: auto;
 }
 
 ul.autosuggest li
 {
  text-align: left;
  border-bottom: 1px solid blue;
  border-left: 1px solid blue;
  border-right: 1px solid blue;
 }
 
 ul.autosuggest li a:link,
 ul.autosuggest li a:visited
 {
  display: block;
  padding: 0px;
  text-decoration: none;
  text-color: black;
  background-color: #EEEEEE;
 }

 ul.autosuggest li a:hover,
 ul.autosuggest li a:active
 {
  color: #fff;
  background-color: green;
 }

 ul.autosuggest li.highlight a:link,
 ul.autosuggest li.highlight a:visited
 {
  color: #fff;
  background-color: green;
 }
 
 
&amp;lt;/style&amp;gt;&lt;/blockquote&gt;
(mask is the id of my iframe btw) and then I had to change some of BSN's javascript to support select-free layer:
&lt;blockquote&gt;_bsn.AutoSuggest.prototype.createList = function(arr)
{
 // clear previous list
 //
 this.clearSuggestions();

 // create and populate ul
 //
 var ulWrap = _bsn.DOM.createElement("div", { id:this.idAs, className:this.oP.className });
 var ulCont = _bsn.DOM.createElement("div", { id:"inner", className:"bd" });
 var ul = _bsn.DOM.createElement("ul", {id:this.idAs+"ul", className:this.oP.className});
  
 var pointer = this;
 for (var i=0;i&amp;lt;arr.length;i++)
 {
  var a = _bsn.DOM.createElement("a", { href:"#" }, arr[i]);
  a.onclick = function () { pointer.setValue( this.childNodes[0].nodeValue ); return false; }
  var li = _bsn.DOM.createElement(  "li", {}, a  );
  ul.appendChild(  li  );
 }
 
 var pos = _bsn.DOM.getPos(this.fld);
 
 ulWrap.style.overflow = "hidden";
 ulWrap.style.left = pos.x + "px";
 ulWrap.style.top = ( pos.y + this.fld.offsetHeight ) + "px";
 ulWrap.onmouseover = function(){ pointer.killTimeout() }
 ulWrap.onmouseout = function(){ pointer.resetTimeout() }
 ul.style.width = this.fld.offsetWidth + "px";
 ulCont.style.width = this.fld.offsetWidth + "px";
 ulWrap.style.width = this.fld.offsetWidth + "px";
 ulCont.style.height = ((ul.childNodes.length-1) * (this.fld.offsetHeight+2)+6);
 ulWrap.style.height = ((ul.childNodes.length-1) * (this.fld.offsetHeight+2)+6);
 
 
 ulCont.appendChild(ul);
 ulWrap.appendChild(ulCont);
 ulWrap.innerHTML += "&amp;lt;!--[if lte IE 6.5]&amp;gt;&amp;lt;iframe id=\"mask\"&amp;gt;&amp;lt;/iframe&amp;gt;&amp;lt;![endif]--&amp;gt;";
 //document.getElementsByTagName("body")[0].appendChild(ul);
 document.getElementsByTagName("body")[0].appendChild(ulWrap);&lt;/blockquote&gt;
In the end it was a real bugger to get going but sure enough my auto suggest is no longer broken by IE's stupid bug.  I hope this helps any other poor souls that face this task.  If you suffer from IE's select bug at all I highly recommend select-free layer.  If I wasn't doing autosuggest too it would have been an easy patch to apply.  I hate IE btw ;)  They made me play DHTM-Hell for a few days this time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116585546890570638?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116585546890570638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116585546890570638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116585546890570638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116585546890570638'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/ie-select-z-index-bug-wselect-free.html' title='IE Select z-index bug (w/select-free layer and autosuggest)'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116542748101148329</id><published>2006-12-06T09:51:00.000-08:00</published><updated>2006-12-06T09:51:21.013-08:00</updated><title type='text'>Javascript date sorting using regular expressions</title><content type='html'>First off, let me say that &lt;a href="http://javascript.about.com/mbiopage.htm"&gt;this guy&lt;/a&gt; is awesome.  I've referenced many of his articles over the years and they're all very helpful.

Specifically, I used his &lt;a href="http://javascript.about.com/library/blsort3.htm"&gt;Date Sort&lt;/a&gt; article today.  I was dealing with an array of dates in javascript and needed to order them.  The functions he lists use a regular expression.  These are rather funky to look at:
&lt;blockquote&gt;var dateRE = /^(\d{2})[\/\- ](\d{2})[\/\- ](\d{4})/;&lt;/blockquote&gt;
but extremely useful and elegant.  He also offers functions like: 
&lt;blockquote&gt;
function mdyOrdA(a, b){
a = a.replace(dateRE,"$3$1$2");
b = b.replace(dateRE,"$3$1$2");
if (a &amp;gt; b) return 1;
if (a &amp;lt; b) return -1;
return 0; }
&lt;/blockquote&gt;
that you can use with Array's sort method to elegantly sort like so:
&lt;blockquote&gt;
dateArray = new Array('15/10/2000','28/05/1999',
'17/09/2005','06/12/2004','02/01/1998');
dateArray.sort( mdyOrdA );
document.write('Ascending : ' + dateArray + '&lt;br /&gt;');
&lt;/blockquote&gt;
Bravo, Mr. Chapman!  Very elegant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116542748101148329?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116542748101148329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116542748101148329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116542748101148329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116542748101148329'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/javascript-date-sorting-using-regular_06.html' title='Javascript date sorting using regular expressions'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116542701185288547</id><published>2006-12-06T09:43:00.000-08:00</published><updated>2006-12-06T09:43:36.746-08:00</updated><title type='text'>JS Array hax: Push Pop Shift and Unshift</title><content type='html'>&lt;a href="http://www.devguru.com/technologies/ecmascript/QuickRef/array.html"&gt; These incredibly useful array methods&lt;/a&gt; are often overlooked and under utilized.  When used properly, if for some reason you need to change your code from appending an array to pre-pending it, you just change from push() to unshift().  It should take all of two seconds.  Without using these functions you'll end up writing 10 lines or so that are SOOOOOO boring you'll want to barf.  

Here's a quick reference of what they do:
push() - add element to the end of the array
pop() - remove and return the element at the end
shift() - remove and return the element at the beginning
unshift() - add element to the beginning of the array pushing the others down 1

Shift and unshift seem to me to save the most time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116542701185288547?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116542701185288547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116542701185288547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116542701185288547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116542701185288547'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/js-array-hax-push-pop-shift-and.html' title='JS Array hax: Push Pop Shift and Unshift'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116534881615805501</id><published>2006-12-05T12:00:00.000-08:00</published><updated>2006-12-05T12:00:16.276-08:00</updated><title type='text'>JavaScript undefined Property</title><content type='html'>&lt;a href="http://www.w3schools.com/jsref/jsref_undefined.asp"&gt;JavaScript undefined Property&lt;/a&gt; - when you need to see if a variable has been defined you can just check if it is equal to the undefined keyword I.E. if (t1==undefined).  This is good to use when you have optional parameters to a function.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116534881615805501?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116534881615805501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116534881615805501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116534881615805501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116534881615805501'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/javascript-undefined-property.html' title='JavaScript undefined Property'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116526492125112759</id><published>2006-12-04T12:42:00.000-08:00</published><updated>2006-12-04T12:42:01.323-08:00</updated><title type='text'>Ajax auto-suggest / auto-complete | BrandSpankingNew</title><content type='html'>I was working on a site enhancement and came across this &lt;a href="http://www.brandspankingnew.net/specials/ajax_autosuggest/jamietest.html"&gt;JS/CSS front end for an AJAX auto complete text box&lt;/a&gt;.  This is  huge as far as the user experience goes.  The front end probably needs some UI tweaking and there's no back end (of course, you'll need to make that use specific) but it's a good start down the road.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116526492125112759?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116526492125112759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116526492125112759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116526492125112759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116526492125112759'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/ajax-auto-suggest-auto-complete.html' title='Ajax auto-suggest / auto-complete | BrandSpankingNew'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116498971388827407</id><published>2006-12-01T08:15:00.000-08:00</published><updated>2006-12-01T08:15:13.906-08:00</updated><title type='text'>Clearing all options from a select</title><content type='html'>OUCH! I wrote &lt;a href="http://bustedmug.blogspot.com/2006/11/select-boxes-clear-all-options-except.html"&gt;this post&lt;/a&gt; to only later learn that doing anything like this:
&lt;blockquote&gt;
if (this.selectedDates.length == 0)
document.getElementById(this.listName).options[0] = new Option("","");
&lt;/blockquote&gt;
is just dumb.  A million times better solution is:
&lt;blockquote&gt;
document.getElementById(this.listName).length = 0;
&lt;/blockquote&gt;
Don't you hate when an answer is blindingly obvious?  I just figured that length would be read only.  Oh well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116498971388827407?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116498971388827407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116498971388827407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116498971388827407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116498971388827407'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/12/clearing-all-options-from-select.html' title='Clearing all options from a select'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116490605647508740</id><published>2006-11-30T09:00:00.000-08:00</published><updated>2006-12-01T08:16:39.663-08:00</updated><title type='text'>Select Boxes - clear all options - except the last one</title><content type='html'>Update:&lt;a href="http://bustedmug.blogspot.com/2006/12/clearing-all-options-from-select.html"&gt;I was a blithering idiot when I posted this.  Read this post.&lt;/a&gt;

If you're messing with dynamic select boxes here's &lt;a href="http://www.javascriptkit.com/javatutors/selectcontent.shtml"&gt;a good reference&lt;/a&gt;.  I ran into a problem.  Apparently you can't remove the last option (makes sense - how can you have no options?).  To make the select appear blank you end up doing something like this:
&lt;blockquote&gt;
   if (this.selectedDates.length == 0)
      document.getElementById(this.listName).options[0] = new Option("","");
&lt;/blockquote&gt;
It just inserts a blank option.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116490605647508740?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116490605647508740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116490605647508740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116490605647508740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116490605647508740'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/select-boxes-clear-all-options-except.html' title='Select Boxes - clear all options - except the last one'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116490064340403023</id><published>2006-11-30T07:30:00.001-08:00</published><updated>2006-11-30T07:30:43.416-08:00</updated><title type='text'>Select boxes and "Could not convert JavaScript argument" (NS_ERROR_XPC_BAD_CONVERT_JS)</title><content type='html'>While trying to add a dynamically generated option to a select box I ran into this error:
&lt;blockquote&gt;
Error: uncaught exception: [Exception... "Could not convert JavaScript argument"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: file:///C:/Documents%20and%20Settings/mmbmb/Desktop/calendar%20de3v/calendarDateInput.js :: PickDisplayDay :: line 148"  data: no]
&lt;/blockquote&gt;
I was perplexed for some time until I did a little research and ran into &lt;a href="http://www.quirksmode.org/js/options.html"&gt;this page on Quirksmode&lt;/a&gt;.  The solution lies here:
&lt;blockquote&gt;&lt;pre&gt;
 for(i=0;i&amp;lt;list.length;i+=2)
 {
  box2.options[i/2] = new Option(list[i],list[i+1]);
 }
&lt;/pre&gt;&lt;/blockquote&gt;
I was trying to call the .add method of a select using text as an argument.  This is non-standard (but I think works in IE).  You have to instantiate an option object or else JS will error while trying to convert.  Quirksmode is great btw.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116490064340403023?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116490064340403023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116490064340403023' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116490064340403023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116490064340403023'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/select-boxes-and-could-not-convert_30.html' title='Select boxes and &quot;Could not convert JavaScript argument&quot; (NS_ERROR_XPC_BAD_CONVERT_JS)'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116490060812048745</id><published>2006-11-30T07:30:00.000-08:00</published><updated>2006-11-30T07:30:08.616-08:00</updated><title type='text'>Select boxes and "Could not convert JavaScript argument" (NS_ERROR_XPC_BAD_CONVERT_JS)</title><content type='html'>While trying to add a dynamically generated option to a select box I ran into this error:
&lt;blockquote&gt;
Error: uncaught exception: [Exception... "Could not convert JavaScript argument"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: file:///C:/Documents%20and%20Settings/mmbmb/Desktop/calendar%20de3v/calendarDateInput.js :: PickDisplayDay :: line 148"  data: no]
&lt;/blockquote&gt;
I was perplexed for some time until I did a little research and ran into &lt;a href="http://www.quirksmode.org/js/options.html"&gt;this page on Quirksmode&lt;/a&gt;.  The solution lies here:
&lt;blockquote&gt;&lt;pre&gt;
 for(i=0;i&lt;list.length;i+=2)
 {
  box2.options[i/2] = new Option(list[i],list[i+1]);
 }
&lt;/pre&gt;&lt;/blockquote&gt;
I was trying to call the .add method of a select using text as an argument.  This is non-standard (but I think works in IE).  You have to instantiate an option object or else JS will error while trying to convert.  Quirksmode is great btw.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116490060812048745?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116490060812048745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116490060812048745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116490060812048745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116490060812048745'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/select-boxes-and-could-not-convert.html' title='Select boxes and &quot;Could not convert JavaScript argument&quot; (NS_ERROR_XPC_BAD_CONVERT_JS)'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116482920702923089</id><published>2006-11-29T11:40:00.000-08:00</published><updated>2006-11-29T11:40:07.050-08:00</updated><title type='text'>JS Hex Color Picker</title><content type='html'>Oh how many million times have I needed a &lt;a href="http://navsurf.com/applets/colorpicker/"&gt;Color Picker&lt;/a&gt;?  I can't count anymore.  I usually end up googling for one but &lt;a href="http://navsurf.com/applets/colorpicker/"&gt;this one&lt;/a&gt; is nice and actually give you the hex in the format you'll use in JS or CSS which is nice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116482920702923089?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116482920702923089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116482920702923089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116482920702923089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116482920702923089'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/js-hex-color-picker.html' title='JS Hex Color Picker'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116482636587158619</id><published>2006-11-29T10:52:00.000-08:00</published><updated>2006-11-29T10:52:45.906-08:00</updated><title type='text'>CSS Date Selection</title><content type='html'>&lt;a href="http://dynamicdrive.com/dynamicindex7/jasoncalendar.htm"&gt;Dynamic Drive DHTML Scripts- Jason's Date Input Calendar&lt;/a&gt; is a great css-enabled date selector.  No need to open a new window and fool with all that entails.  This is nice and clean.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116482636587158619?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116482636587158619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116482636587158619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116482636587158619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116482636587158619'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/css-date-selection.html' title='CSS Date Selection'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116474948175103459</id><published>2006-11-28T13:31:00.000-08:00</published><updated>2006-11-28T13:31:21.763-08:00</updated><title type='text'>Foreach in Java</title><content type='html'>As a php to java convert (mandated by my employer) I always forget the java version of for each.  Sun, of course, has &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html"&gt;a good for each reference and tutorial&lt;/a&gt; but it is a little long winded.  to break it down:
&lt;pre&gt;
    for (TimerTask t : c)
        t.cancel();
&lt;/pre&gt;
means "For each tasktimer in c, assign it to t and do .cancel."  These make your code much more elegant.  I use them whenever possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116474948175103459?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116474948175103459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116474948175103459' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474948175103459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474948175103459'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/foreach-in-java.html' title='Foreach in Java'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116474709372136391</id><published>2006-11-28T12:51:00.000-08:00</published><updated>2006-11-28T12:51:33.776-08:00</updated><title type='text'>Comma separated lists in java</title><content type='html'>I find myself doing this for a user a million times and have taken until now to take care of the formatting somewhere else.  If you need a list that has commas in between items, but of course doesn't have a trailing comma, something like this is handy:
&lt;pre&gt;
 /**
  * bch: formats a comma-separated list
  * @param items string separated by spaces
  * @return list in format a, b, c
  */
 public static String commalist(String items) {
  StringTokenizer st = new StringTokenizer(items);
  StringBuffer sb = new StringBuffer();
  while (st.hasMoreElements()) {
   sb.append(st.nextToken());
     if (st.hasMoreElements()) {
    sb.append(", ");
   }
  }
  return sb.toString();
 }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116474709372136391?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116474709372136391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116474709372136391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474709372136391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474709372136391'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/comma-separated-lists-in-java.html' title='Comma separated lists in java'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116474568168222456</id><published>2006-11-28T12:28:00.000-08:00</published><updated>2006-11-28T12:28:01.730-08:00</updated><title type='text'>gotAPI/search</title><content type='html'>I just can't get enough of &lt;a href="http://start.gotapi.com/"&gt;gotAPI&lt;/a&gt;. It's an awesome developer tool that will allow you to specify the technologies that you're working on so that you're only searching those APIs.  Too cool.  It has a real web 2.0 feel to it too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116474568168222456?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116474568168222456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116474568168222456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474568168222456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474568168222456'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/gotapisearch.html' title='gotAPI/search'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116474265407406936</id><published>2006-11-28T11:37:00.000-08:00</published><updated>2006-11-28T11:37:34.163-08:00</updated><title type='text'>Obvious yet useful</title><content type='html'>Every programmer needs to have some of those completely obvious and simple functions taken care of in their toy box.  Here's one that I programmed 1000x before realizing I should really code it once and be done:

public static String nvlb(String source, String falseCase) {

 if (source == null || source.equals(""))
  return falseCase;
 else
  return source;
}

Put this as a static member of your class and you'll never need to code out replacing a null or blank string to throw into some sql again.  It will eliminate some keystrokes, but ranks high on the DUH factor :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116474265407406936?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116474265407406936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116474265407406936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474265407406936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116474265407406936'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/obvious-yet-useful.html' title='Obvious yet useful'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116422825695917856</id><published>2006-11-22T12:44:00.000-08:00</published><updated>2006-11-22T12:44:16.973-08:00</updated><title type='text'>Firefox, IE vulnerable to fake login pages? | CNET News.com</title><content type='html'>&lt;a href="http://news.com.com/2100-1002_3-6137844.html?part=rss&amp;amp;tag=2547-1_3-0-20&amp;amp;subj=news"&gt;Firefox, IE vulnerable to fake login pages? | CNET News.com&lt;/a&gt;

Very tricky.  A testament to not saving your passwords.  What will they think of next?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116422825695917856?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116422825695917856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116422825695917856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116422825695917856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116422825695917856'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/firefox-ie-vulnerable-to-fake-login.html' title='Firefox, IE vulnerable to fake login pages? | CNET News.com'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116422505448119329</id><published>2006-11-22T11:50:00.000-08:00</published><updated>2006-11-22T11:52:16.636-08:00</updated><title type='text'>Busted Jar</title><content type='html'>In Websphere 5.1.2 I keep running into this issue with one of my external jars.  It happens to be gnu.regexp but that's not really consequential I don't think.  Anyhow, this jar keeps getting unincluded and the only way I can fix it is to go into Server Configuration&gt;Environment and add it back in.  It suckos :P  If anyone know what can cause this I am all ears - this one might be my bad, I'm not sure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116422505448119329?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116422505448119329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116422505448119329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116422505448119329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116422505448119329'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/busted-jar.html' title='Busted Jar'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116420614640358669</id><published>2006-11-22T06:35:00.000-08:00</published><updated>2006-11-22T06:35:47.100-08:00</updated><title type='text'>Attack code targets zero-day Mac OS X flaw | CNET News.com</title><content type='html'>In other news Pigs have grown wings and started to fly - &lt;a href="http://news.com.com/2100-1002_3-6137710.html?part=rss&amp;amp;tag=2547-1_3-0-20&amp;amp;subj=news"&gt;Attack code targets zero-day Mac OS X flaw | CNET News.com&lt;/a&gt;

When you claim to be so secure that anti-virus software doesn't exist it is going to be pretty tough to deal with an outbreak of this.  It's a good thing no one is actually using Macs anywhere, lol.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116420614640358669?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116420614640358669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116420614640358669' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116420614640358669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116420614640358669'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/attack-code-targets-zero-day-mac-os-x.html' title='Attack code targets zero-day Mac OS X flaw | CNET News.com'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116413371621238749</id><published>2006-11-21T10:28:00.000-08:00</published><updated>2006-11-21T10:28:36.233-08:00</updated><title type='text'>Bill O'Reilly: Tech helps the terrorists win | News.blog | CNET News.com</title><content type='html'>Oh gosh: &lt;a href="http://news.com.com/2061-10801_3-6137306.html?part=rss&amp;amp;tag=2547-1_3-0-20&amp;amp;subj=news"&gt;Bill O'Reilly: Tech helps the terrorists win | News.blog | CNET News.com&lt;/a&gt;.

In the course of this babbling O'Reilly, the oft ranting commentator on Fox News said ""I really fear for the United States because, believe me, the jihadists? They're not playing the video games. They're killing real people over there."

Take a gander at the CNet article to get the whole gist, but basically he's insane.  Apparently he'd rather have America's teenagers doing something productive via killing real people?  Or perhaps he didn't mean to say that and it was just Freudian.  In any case someone please buy him a clue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116413371621238749?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116413371621238749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116413371621238749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116413371621238749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116413371621238749'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/bill-oreilly-tech-helps-terrorists-win.html' title='Bill O&apos;Reilly: Tech helps the terrorists win | News.blog | CNET News.com'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116412131571470540</id><published>2006-11-21T07:01:00.000-08:00</published><updated>2006-11-21T07:01:57.443-08:00</updated><title type='text'>Oracle's stupid column indexes</title><content type='html'>Oracle has really dumb column indexes.  Instead of starting with 0 like the rest of the computer science world, they chose to go with 1 as the first.  Thus, even the most seasoned programmer will often fall for this rookie mistake because programmers know that in CS 0 is first.  Consequently, you'll get a &lt;a href="http://www.dbmotive.com/oracle_error_codes.php?errcode=17003"&gt;ORA-17003: Invalid column index&lt;/a&gt; error and usually it's pretty easy to spot.  None the less this is extremely annoying.  I wish Oracle would fix it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116412131571470540?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116412131571470540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116412131571470540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116412131571470540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116412131571470540'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/oracles-stupid-column-indexes.html' title='Oracle&apos;s stupid column indexes'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116405879963438794</id><published>2006-11-20T13:39:00.000-08:00</published><updated>2006-11-20T13:45:27.930-08:00</updated><title type='text'>java.lang.IllegalAccessError</title><content type='html'>The &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalAccessError.html"&gt;java.lang.IllegalAccessError&lt;/a&gt; is one of those stupid litte "Duh" kind of errors.  This little nasty came along, apparently, because I needed a method to be public instead of private.  This it tough to get.  You have to have an interface class that has a public member that calls a private method.  The compiler should pick them out but in my case didn't do the job until after I was muttering "WTF" and bashing my keyboard.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116405879963438794?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116405879963438794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116405879963438794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116405879963438794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116405879963438794'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/javalangillegalaccesserror.html' title='java.lang.IllegalAccessError'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116403537005217935</id><published>2006-11-20T07:09:00.000-08:00</published><updated>2006-11-20T07:09:30.060-08:00</updated><title type='text'>The ? : operator in Java</title><content type='html'>&lt;a href="http://www.cafeaulait.org/course/week2/43.html"&gt;The ? : operator in Java&lt;/a&gt;

These are great but seldom used.  I recommend it.

I.E. output = obj.getShowA() ? a: "Not showing a";

It simplifies the multiline structure.  Fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116403537005217935?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116403537005217935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116403537005217935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116403537005217935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116403537005217935'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/operator-in-java.html' title='The ? : operator in Java'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37672055.post-116385796757018601</id><published>2006-11-18T05:51:00.000-08:00</published><updated>2006-11-18T05:52:47.570-08:00</updated><title type='text'>First Post</title><content type='html'>This is the first post.  I'll probably delete it later.  Oh yeah, boobies!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37672055-116385796757018601?l=bustedmug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bustedmug.blogspot.com/feeds/116385796757018601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37672055&amp;postID=116385796757018601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116385796757018601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37672055/posts/default/116385796757018601'/><link rel='alternate' type='text/html' href='http://bustedmug.blogspot.com/2006/11/first-post.html' title='First Post'/><author><name>Brando</name><uri>http://www.blogger.com/profile/16369676054909411805</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://i9.photobucket.com/albums/a74/brandonhimes/profimgcopy.jpg'/></author><thr:total>0</thr:total></entry></feed>
