Cookies and Frames

Sometimes, I just don’t have the time to blog even if I have something interesting to write about. I also try to only update with relevant posts. FYI.

I spent last week fixing up some JavaScript on a site that has frames. While I have plenty of past experience that tells me using frames is bad, this one took the cake. Here’s why.

  1. Everything is dandy until you have to have a frame access the other’s variables. This did not go smoothly in IE7. I was very flustered with that since it was “supposed” to work.
  2. JavaScript functions need to be placed globally. This was a problem when I had two frames work closely together until one frame got logged out by the system and popped to the login screen (complete with missing function declarations)!!

The moral of that story is not to use frames!

Also, I got to play with cookie manipulation in JavaScript. This was new to me. Which, by the way, was the eventual solution I used to have my two frames pass data back and forth. Anyway, cookies are WEIRD in JavaScript.

They are accessed through the “property” document.cookie. However, unlike regular properties, when you assign a cookie, you use a different format  than when you output it. In other words, assignment looks like:

document.cookie = “some cookie string that’s gibberish I don’t want to explain now”

Whereas reading the cookie (document.cookie) returns the data values for *all cookies* for the current domain. Oh, and in one giant semi-colon delimited string. Annoying.

My advice on using cookies in JavaScript? Write a class that manages them first.

What NOT to Name Your Form Fields

This one is a programming post. Did you know you should never, ever, EVER name a field in your form “submit”. If you recall my previous posts, you’d recall that JavaScript can treat any old regular variable as a function. If you stupidly name your submit button “submit,” which I’ve seen done all the time, you overwrite your form’s ability to call the submit method!!!

Don’t do this:

<input type=”button” name=”submit” value=”push me” />

Or…

<input type=”text” name=”submit” value=”” />

Etc. It all messes up your JavaScript!

In other words, the following otherwise working function calls completely break (and you get cryptic errors about undefined functions or incorrect parameter counts):

document.form[‘form-name’].submit();
this.form.submit();
document.getElementById(‘form-id’).submit();

They all fail because “submit” now refers to your form field that you created, which clearly isn’t the function you thought you were calling!

Media Distribution Done Right: ABC

So a few weeks ago, Lost premiered its third season. While I was dying to watch the premier, I, as usual, was stuck at work pulling a late night. The next day, I went to work again and stayed another late night. Wanting desperately to watch the show, I thought about my options. Lost is one of those shows you can’t just miss an episode and then jump in the next one and still feel satisfaction.

Now normally, someone from my age group would go and “torrent” the episode. Well, that or use iTunes. But I am not comfortable with the notion of DRM. Joe user went to piracy because either nothing was offered to meet the demand that was there or because the solutions offered were too draconian. Recently, an executive from Disney was quoted (famously) for saying that DRM is something to compete with as a business model, rather than view it as a scourge. I recalled this quote and remembered that ABC was offering their shows online.

So I went to ABC.com and looked for Lost. Needless to say: I WAS IMPRESSED. Now this is just my personal opinion, but if all networks did this, I would cancel my cable TV subscription in a heart beat. Here’s the highlights of ABC’s online TV offering:

  • Quality: The content is at a quality at or very near to what you would see if you downloaded the show from iTunes or other less “legal” means.
  • Speed: Unlike waiting to download something, I was able to immediately begin watching the show and it streamed the rest in as necessary. The delay to begin watching was about 3 seconds.
  • Commercials: Regular TV commercial breaks are 3 – 5 minute each. Well on the Internet stream, it is one commercial per break — 30 seconds. And when it finishes, a “resume” button appears so if you really needed to go to the bathroom, you can come back on your own time. As a side note, the advertising was probably one of the more effective ones I’ve witnessed for TV content. Because the sponsor’s logo appears at the top during the episode, I actually remember the advertisers (All State and Century 21).
  • TiVo functionality: I can pause or skip around at will.

This was 100% lost revenue for ABC had I downloaded it using BitTorrent. Or worse yet, I could have been “too busy” once or twice more and never seen the show again because I “fell too far behind.” It seems no matter how you slice it, if the show is at an inconvenient time, but I really love the show, in the older days, the network would have had to simply lose me as a viewer.

There’s some real draws in what ABC has done here.

  • With this new model, they can focus on quality shows and not really have to worry about competing time slots and placing “filler” stuff.
  • Let’s say the network launches a new show. Right now, they have to heavily entice a consumer to view the show to get them hooked. Now, the barrier to entry is much lower because the time slots of other more popular shows matter far less.
  • Telling someone “man this show is soooo sweet” is as simple as sending a link.
  • Old shows can continue to be popular and pull in ad revenue. In today’s medium, you have to rotate out re-runs because of the opportunity costs.

I have a few ideas on how ABC or other networks could vastly improve this service.

  1. Put all past shows up on the service. This will draw in a huge fan base who can then begin looking at other shows and generate new fans that previously did not exist.
  2. Don’t add in more commercials. Notice what I liked about this service and why I would choose it over TV. Fill it up with ads and you stand to drive your consumers straight back to piracy. Consumers don’t mind ads so long as they don’t dwarf the content (think “sugar with your coffee”).
  3. The quality is excellent, but it is missing a full screen mode. I’ll be honest here, you can toss this in as a feature you get with a subscription service. This subscription service would give you access to additional content that regular free users can’t, such as shortened commercial breaks, commentary, deleted scenes, etc.
  4. Integrate the ability to blog about the episode. If you do this, you will create a centralized community that will generate buzz all on its own. Don’t compete with MySpace. Just make each episode have its own trackback link and other forms of social integration such as a Digg link.

I’m really excited to see how things turn out with this. With the GooTube purchase, it seems more and more likely this will be just the beginning of things to come. I hope other networks follow this awesome example (and improve it). If you’re competing with free, the only way to win is to offer better service and ease of use, which is exactly what ABC did here.

GooTube Rumors to be Confirmed Tomorrow?

So it’s entirely possible this whole Google-YouTube ordeal is a classic case of an echo-chamber. Since its initial appearance in the media, the deal went from being in a “sensitive stage” to a confirmed sale. Who knows what’s really going on here. This could be a classic case of circular citing gone awry, but, personally, I really think this rumor has substance.

I didn’t touch on this point on my last post too much, but $1.6 billion is a steal for YouTube. First, imagine if MSN were to lock in a deal with Youtube for advertising. Not only would that help one of Google’s most feared rivals, but the opportunity costs are through the roof. Seeing as YouTube has an immense amount of traffic, an exclusive advertising deal could easily cost upwards of half a billion dollars. And that’s what a company would PAY just to show ads — the actual revenue generated is far greater. Additionally, if the next big medium for advertising on the web is through video, having a 60% market cap on net videos (Google has 10% now) would be a huge advantage.

There’s been rumors that the price is 2.1 billion. Imagine if an exclusive deal with YouTube was worth half a billion. And then the deal itself generated another 1 billion in revenue over the next three years (using the MySpace deal numbers here). It’s still a considerable bargain if it means shutting out Yahoo and Microsoft from becoming the Internet’s most notorious content provider (after MySpace, of course).

Is the “rumor” real? Who knows. But I think this is one deal Google shouldn’t pass up. They have 10 billion in cash and nothing to spend it on. They might as well become number 1 in another segment besides search.

YouTube and Google?

Techcrunch just covered the possibility that Google is looking to buy YouTube for $1.6 billion.

I think this acquisition makes a lot of sense. While it was pointed out that Google would be unafraid of the copyright issues, I think another reason why the acquisition is a safe bet is because Google can support the infrastructure and bandwidth costs. Owning YouTube would not be a significant strain on a company’s hardware resources. Seeing as Google seems to have a genuine interest in the video market, signified by the presence of Google Video — which was NOT a free-time-project-gone-gold — I’d say this acquisition has a lot of potential to be true.

If the future of the web is in streaming media, owning the current #1 player would be the smartest way for Google to maintain their edge. What’s surprising is how little speculation there was of this acquisition until this post. It seems like a completely random shot in the dark.

I will say that the acquisition doesn’t sit right with me 100%. Google is not a content provider, and owning YouTube and investing $1.6 billion dollars pretty much guarantees they MUST focus on being a content provider as well as an ad broker. Perhaps they’re starting to realize that in order to keep Microsoft off their toes they need to own some of the content as well? Of course then they’d be competing with AOL, Yahoo!, and MSN for content, but having YouTube certainly would help in that race.

Of course this all assumes the rumor has any substance.