FireFox bug with onreadystatechange

May 24th, 2008

Just ran into this bug in FireFox: https://bugzilla.mozilla.org/show_bug.cgi?id=412112. Basically, if you do a synchronous call on an XMLHttpRequest object, the onreadystatechange function is not called. So the following code doesn’t work.

var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState == 4)
  if (request.status == 200) alert('request successful')
};
request.open("GET", "/index.html", false); /* the false here makes it synchronous *
request.send(null);

(more…)

Recording The Daily Show on Tivo

May 13th, 2008

I just upgraded my Tivo to a Tivo HD (very cool) and lost the old tip on how to avoid recording 5 copies of The Daily Show every day. Apparently Comedy Central doesn’t provide enough metadata for the Tivo to figure out when an episode is new and when it is a rerun. This little trick was in a Tivo Newsletter:

WishList(r) Search Suggestion: De-dupe Your Now Playing List
(more…)

IE vs FireFox: Using JavaScript to modify attributes

April 19th, 2008

I was working on an interesting little project involving the Google Website Optimizer and ran into this little gem.

The task was to use JavaScript to rewrite a page that was formatted using tables and was sometimes missing a row that spanned the whole table. Now I have to admit that I am not a JS or DOM pro, But I’ve picked up though some experience through this and a couple other tasks. So here is the base HTML: (more…)

One John’s problems

April 13th, 2008

I often run into interesting problems in my work and in my play.  But finding solutions on the web can be challenging.  So I decided to start recording them so that if somebody else ran into them as well they might find them.  For the record, I am currently using Gentoo Linux, Apache, MySQL, and Perl at work, so I expect most of the problems to be related to one or more of those systems.  Also, I am not a writer.  So don’t expect wonderful prose.  But please leave a comment if it helps or if you think more clarification is needed.