Java

IE/JavaScript Insanity – appendChild() changes the appended object!

I’ve been hacking around with Javascript a good bit lately. Since we’re writing internal apps at the moment, we can more or less dictate what browsers to use, or at least we can insist that we will NOT support Netscape 4 and IE
function addRow( rowName, myValue ) {
var newItem = document.getElementById(“blankItem”).cloneNode(true);
var group = newItem.getElementsByTagName(“span”).item(0);
group.appendChild(document.createTextNode(rowName));
var checkboxes = newItem.getElementsByTagName(“input”);
checkboxes.item(0).checked = myValue;
alert(newItem.getElementsByTagName(“input”).item(0).checked);
itemList.appendChild(newItem);
alert(newItem.getElementsByTagName(“input”).item(0).checked);
}

blankItem is defined elsewhere in the page as:

  <tr id="blankItem">
    <td><span></span></td>
    <td><input type="checkbox" name="test"></td>
  </tr>

The intent here is to add a new row to a table based on user input from a form. It works great in Mozilla/Firefox. But clearly someone working on Internet Explorer was smoking crack the day they wrote the code to support this (version 6.0.2800.1106). Changing the span to contain the user text works fine. But interesting things happen when you change the value of the checkbox. The default value is true. If you pass false into the function, the first debug statement shows false, but the second shows true. The appendChild() statement actually changes the element being appended! How or why this happens, I can’t say, but it took me a couple of hours of frustration to get past it. One more reason I wish people would abandon using Internet Explorer.

Advertisement
General

Dude, Where's the General Lee?

For the Dukes of Hazzard movie remake, the parts of Bo, Luke, and Daisy have all been officially cast. As had been widely rumored, Daisy will be played by Jessica Simpson. Not a bad choice, depending on the rest of the cast. But here’s the problem – Johnny Knoxville and Seann William Scott have been cast as Bo & Luke. I won’t pretend that the original series was some paramount of high class and acting, but this casting decision makes me think of a movie full of fart jokes and slapstick humor. Consider further that the director has brought us such quality films as “Super Troopers” and “Club Dread”, and such a fate seems inescapable.

Either way, I doubt this movie will lose money. It’s one of those guaranteed paychecks. But you’d think after seeing how well a movie can do when it respects its source material (X-Men/Spiderman/Lord of the Rings) instead of pumping out mindless MTV tripe (Starsky & Hutch, Charlie’s Angels), they’d choose to take the higher road and make MORE money.

Technology

Information Superhighway Robbery

More information has been imprisoned behind dollars and cents. The Atlanta Journal Constitution had already jumped on the registration bandwagon, forcing you to give up name, address, email, and your soul in exchange for the privilege of reading their news. About a year ago, they took all of their sports columnists – pretty much sports editorials – off to a pay site – $6 a month or $30 a year. The result? Atlanta sports talk radio had fewer discussions and fewer callers about the columns that were published. My friends and I now rarely, if ever, discuss what was written.

So I’m guessing after about a year of floundering about, wondering why more people weren’t paying to read a bunch of second-rate sports opinion columns with odd biases (imagine a Kentucky fan talking about ACC football), they decided the answer must be that they simply weren’t squeezing people hard enough. The freeloaders apparently had to go, so now, only the most fact-based, mainstream sports articles are free. Any in-depth or peripheral stories are not a part of AJC Sports Plus. So you can find out the score of a game, and the game write-up for free, but the stories about the announcer undergoing cancer treatment, what I presume to be a game preview, and GT vs. Miami selling out are all apparently something I have to pay for. Never mind this and this, which give me the same information for free. This will always be the case. There will ALWAYS be another outlet for the same information, except for the editorials, which most people can do without.

As web serving becomes cheaper and the web audience continues to increase, the content-based sites that will prosper will be the ones that can get good advertising contracts and lots of viewers. Look at television – there are only a few channels that can get away with charging for premium content, most notably HBO. And in television, the content is copyrighted, and the limited bandwidth limits the number of content providers. The AJC’s feeble attempt at premium content is like charging HBO prices for a channel that shows only made-for-TV movies in an area with thousands of broadcast channels. Their content is neither unique enough nor of high enough quality to become anything but irrelevant.