Archive for July, 2006

Web 2.0 tricks with Prototype - Creating a drop down list.

Monday, July 31st, 2006

I don’t often write about programming, but times are changing, so perhaps I should change too. And, rather than wearing out the buzzword, I wanted to walk through some tricks I picked up while re-learning how to program in ‘Web 2.0.‘ I’m very hands on, so rather then picking up another server language, ie: diamonds on wheels, I wanted to cut right to the chase and learn or re-learn JavaScript.

Let me start by saying I am not a JavaScript programmer. My strengths lie in PHP/MySQL, so anytime I wanted a variable, I had to goto the server to get it, or pass it via GET, again going to the server. The whole concept of never refreshing the page was a huge one to overcome, so hopefully I can help a few people out there. Most of the concepts described use Prototype in some shape or form.

Let’s just jump right into the deep end. I’m going to make some assumptions. Maybe you are coming from a similar background and your JavaScript ability has been primarily used to sprinkle some snazz to your form or add an interactive button to something minor. With Web2.0 you really can’t stop short. It’s an all or nothing commitment, and anything less will just look like someone broke the salt shaker over sprinkling.

Let’s say you wanted to build an option list of countries. This has been done hundreds of times and hundreds of different ways. You might have done it like this before:

Â? listing1.gif

The problem with this is you fetch the data once and render it to the screen making it really hard to reuse again without going back to the server.

We could fix the problem by creating a JavaScript array and looping through it, butÂ? we’ll even go one step further.Â? We’ll create a Javascript Object that will hold the list. In fact, we could create an instance to hold any list of information -Â? states, countries, whatever.

listing1.gif

So now can keep our data organized. Each field will have three properties: name, value and set (ie. selected or checked). We have 3 methods: newDD() creates a new entry into the dataSet, get() gets a record by value, and set() sets a record by value. Now lets see how to populate the data set.

Everything should make sence here except for that JSON.parse(…);. We use JSONÂ? (JavaScript Object Notation) to send and receive the data from the server. Think of it like using XML or Soap or RSS, but with less mess.

We still are a little way away from actually displaying our drop down list. Lets look at the server side of the this:

Now things are coming together, but we still need a few more JavaScript functions. We want a way to display our list, and we need a way to fire the whole thing.

Oh, before you look at this next function, I forgot to tell you. We are using another resource, Builder.js. I use it to dynamically create node trees I need to insert into the DOM. Builder.js is available here.

Lastly, the HTML…

This file is basically setup like any other. It will call inÂ? four other JavaScript files:

  1. Our Prototype framework (http://prototype.conio.net/)Â?
  2. JSON, used to transport data to and from the server (http://JSON.org)Â?
  3. Builder.js to create nodes easily throught Javascript(http://svn.oscommerce.com/trac/browser/branches/hpdl/oscommerce/ext/scriptaculous/builder.js?rev=587)
  4. Our own javascript file.

There are lots of areas for improvement, but this should give you the general idea. Feel free to see the demo in action here.

Food For Thought

Monday, July 31st, 2006

Amidst all the talks of the beginning of World War III happening in the Middle East as we speak, a local radio station had open phones and one of the callers made a comment about what’s going on in the rest of the world compared to here. He says, ‘The worst thing we have to worry about here is the traffic. I love living in Canada.‘ Amen to that and we’re all hoping for a swift end.

The Latest on Google

Thursday, July 27th, 2006

Regardless of what Google does, everyone in the world of the Internet seems to listen. Unfortunately for the search giant, it seems that the initial excitement over new releases is the only use that many of these projects seem to get. We’ve been somewhat critical of Google - from our post on Google Press DayÂ? to our post about Google’s role inÂ? digital media -Â? in our blog, but that’s mostly because we expect more from Mountainview.

The very name of the company has now been established as a verb in both the Merriam Webster Collegiate Dictionary and Oxford English Dictionary, meaning ‘to use the Google search engine to obtain information on the Internet.’ With that kind of influence on pop-culture, it’s understandable the critics would have high expectations. In 2004 and early into 2005, Google had put out several popular releases that were well received by the industry and average user alike. Google Earth, Google Maps (which grew to include Google Mars and Google Moon), and GmailÂ? definitely impacted the online experience. Both Microsoft and Yahoo! had to make drastic improvements to their email systems to compete with Gmail. The same can be said about the impact of Google Earth and Google Maps. Microsoft and Yahoo! were way behind after these three releases, and it seemed that Google could do no wrong. But were these releases that significant to Google themselves?

When looking at Google Properties, Gmail and Google Maps are ranked third and fifth for percent usage, respectively. The search engine, image search, and news fill out the first, second, and fourth spots. Google Earth may be ranked twelfth on that list, but the use of the product by major media outlets is hard to ignore. In short, these three releases, all released in less than a year, have become important pieces to the Google empire. So where do some of the other recent releases rank?

Google Video, GTalk, and Google Calendar are three recentÂ? releases that have been significant to the Internet.Â? Although Google may not be the dominant player in theÂ? area ofÂ? online videos, Google is the only company to have aÂ? definiteÂ? model for monetizing the content.Â? The ‘open video marketplace‘Â? is definitely a huge stepÂ? towards the digital revolution, but the service could almost be described as trash mixed with treasure. And even if some of the problems in that New York Times article have been addressed, it brings up the idea of a public beta that Google has made so popular. When Google Calendar was released, we posted about the service and had twoÂ? points about it that were positive. The only problem was that the bugs were so significant, we had to comment about those first. So what about GTalk? I’ve personally never used the service, but I will admit, Silent Rob is quite fond of it. So, since we were split on this, I went to the people. First, Mr. Michael Arrington’s post, then Mr. Om Malik’s post, and then this small little operation called the New York Times had an article about Google and Yahoo that talked about GTalk - this table is quite telling.

The overall message in the article from the New York Times was that Google and Yahoo! had different approaches to achieve the same goal, something summed up in the title as Consistency vs. Wow. Having been a Yahoo! user for several years, I have been impressed with their services, their integration, and to put it simply, the consistency of what they’ve done. Google, on the other hand, does seem to be very hit and miss, and as the new kid on the block, it can afford to take that approach. However, as people become more and more attached to the Internet, it’s likely that they will become less and less fond of the frustrations that come with wow and move towards what works.

So that must just leave us with one question - Where is Microsoft in all this?

Web 2.0 Articles

Friday, July 21st, 2006

A couple different, interesting Web 2.0 articles to check out. Two are written by Tim O’Reilly, and the third was written by James Fallows. Mr. O’Reilly is the founder and CEO of O’Reilly Media, Inc. You can read his bio here and his short bio here. The first article we will link to that Tim wrote is an oldy but goody, written on September 30th, 2005 for O’Reillynet.com. The article is titled ‘What is Web 2.0‘ and is an in-depth look at the Web 2.0 movement that we seem to be in the midst of. Many people have seen this image on FlickrÂ? - (look at this search for the image on Flickr to realize how far reaching the image and post were).

The other two posts are what bring this original post up. Mr. Fallows made a post on the website Technology ReviewÂ? about his attempt to live on the ‘new Web’ for two weeks. James makes a quote in his article about a website, Dodgeball, and how it ‘clearly meets most of the standards Tim O’Reilly, of O’Reilly Media, laid out last fall in his manifesto “What is Web 2.0.” .‘ Tim posts a response to what James wrote, and comes up with an interesting hierarchy of Web 2.0. Time basically states that people are too quick to label a website or application as being Web 2.0, and that it takes more than the inclusion of Ajax to earn this lofty title.

The meaning of Web 2.0 will almost certainly have some degree of debate or controversy, butÂ? there is definitely a lot of truth to the idea that this is more a a greyscale than a simple black-and-white subject. The post does as good a job as any at describing the differences between a variety of popular websites that have been touted as ‘Web 2.0,’ but as long as there is not a definitive definition or unanimous decision on what this overused buzz word really means, it will remain a topic of debate, andÂ? these articles are definitely recommended reading to help with this debate.

Battles of the Big Boys

Thursday, July 20th, 2006

The largest companies in the online world continue to battle it out, with several releases in the last few months from several different websites vying for top spots. AOL (AOL-Time Warner)is the largest Entertainment company in the world and has been making several major moves to solidify the company online. The company released three big pieces to their online empire in the last few months, AIMPages, UnCut Video, and the reinvention of Netscape to a Digg-like website. We’ve talked about these releases from AOL in a couple posts on the digital eraÂ? and when AIMPages and UnCut Video were first released.

These were all important moves, but have they really paid off the way the Entertainment giant would have hoped? The top graph shows the traffic rank data for AIMPages over the last three months. There was an initial spike in rank, shooting up to nearlyÂ? a ranking of nearlyÂ? 5000, but the site seems to struggle to stay in the top 100,000. For a site like AOL, a social networking site is a no-brainer. The potential for the site to be built upon as a core service, or as a limb of the company that takes advantage of other core service features, is obvious to anyone following the industry. But for a respected giant like AOL to be doing so poorly out of the gates while relatively small and inexperienced sites have made greater impacts is probably somewhat of an embarassment. The AIM network that AIM Pages targets is still an important piece of the puzzle, but hopefully AOL can create a stronger pull to the site from their IM userbase.

Despite the troubles of AIM Pages, the Netscape experiment seems to be even worse. Michael Arrington made a post on TechCrunch about the troubles Netscape has been having. The powerhouse known as Digg apparently has a very small group that submits a majority of the stories, and Netscape is trying to buy them off. A post by Jason Calacanis,Â? the gentleman in charge of the Netscape property, offers the top 50 users on any of Netscape’s competing sites (DIGG, Delicious, Reddit, etc.). Looking at the ranking of Netscape for the last 6 months, the site is in steady decline. The one spike that is seen around mid-June is probably the official release of Netscape as a Digg-like website, and shortly thereafter, there was a huge decline in rank. This seems like a fairly desperate attempt at the corporate giant trying to buy and/or bully its way into the party. It’s easy to agree that these top users are worth being paid, but we still think this is desparation.

AOLÂ? could even beÂ? losing ground at the IM level. Yahoo! and MSN just released their newest IM’s that not only include the ability to have high quality video conversations, they’ve joined forces and allowed the two networks to work together with either IM. The MSN Messenger (or Windows Live Messenger) network and Yahoo! Messenger network combined is approximately 350 million users. This almost creates a situation where if you can’t beat ‘em, join ‘em. Will we soon see AIM added to this all-new IM network?

Not to be outdone, MySpace continues to plug along as the unstoppable juggernaught. The search on MySpace has now entered the mix as one of the top search engines. The release of MySpace Video and MySpace Comedy are definitely important in maintaining what the site has achieved, which, depending on who you believe, is either the number one site on the Internet or at leastÂ? something close to that.Â?

Google, meanwhile, seems to continue to thrash its arms around in no clear direction. Buoyed by the strength of its search engine and PPC ads, Google continues to do well. The only drawback to Google, it would seem, is that there is little if anything else they can do well outside of their search engine. A post by Paul Kedrosky today looks at the Hitwise data for the search giant. The following statement says it best:

In addition to how concentrated Google traffic remains — even when you take out core search — it’s also worth considering the percentage of top Google properties launched within, say, the last two years. The answer: None of the top five.

Â?