Archive

Posts Tagged ‘browser’

Firefox: Viewing Entire Title Attribute

June 12th, 2008

One of my biggest pet peeves about Firefox was the inability to see the entire title attribute of a DOM element. The title attribute is the text you see in a small pop-up box when you hover over an image, link, or anything on a page. It allows the site to give further information about any element on a page.

The developers at Firefox decided to truncate that text to 60 characters so the user won’t get a huge text box covering their screen whenever they hovered over an element with a long title attribute. In most cases, this would be just fine but I happen to be a big fan of xkcd, a geeky internet web-comic which uses the title attribute to add funny quips.

Using the Long Titles extension, you never have to dig around to read the entire title attribute again. Being such an open browser, I find it rather annoying that Firefox developers refuse to make it an option in about:config to change the cutoff limit for title attributes.

web , , , , , , , , , , , , , , , , ,

Web2.0 Equals Two-Times the Work

June 3rd, 2008

Today a co-worker of mine, Travis, made a really good remark which is the title of this post. Before AJAX, there were only two main components to the site: 1) dynamic server-side processing, and 2) static client-side elements. With AJAX, there is now a third layer that manipulates static elements to make them dynamic and is able to make requests from the server with or without user interaction. Client-side Javascript always has to account for the capabilities of the user’s browser and how certain browsers renders elements even though HTML/CSS also has to handle this. This added complexity, plus the regular bugs that always crop up while coding, makes debugging an AJAX application twice as hard. Despite the extra work for developers, the rich interaction that the Web2.0 era is built upon makes for a much better overall user experience.

internet, programming , , , , , , , , , , , , ,

Ode to Firefox… for real this time

March 22nd, 2008

Firefox is the best browser out there. That’s one argument nobody will ever convince me otherwise. Sure Opera uses less memory, Safari renders pages faster and IE isn’t even in the conversation. In the end, Firefox provides the best experience for the less technically inclined to the most advanced users.

Being a web developer, Firefox has some of the best tools out there for testing forms, debugging Javascript and interactive HTML/CSS editing. If you are a web developer and haven’t heard of Firebug, then you really aren’t a web developer. Other great tools include the Web Developer’s Toolbox and FasterFox.

Recently, Jay mentioned Firefox 3 Beta 4’s release and I really wanted to try it out. I had to keep Firefox 2 for testing purposes so I did a google search and discovered this post showing how to run both versions without them clashing (they can’t run at the same time) on linux. Now I’m running a much improved Firefox with better memory management (not THAT much better), faster page rendering and the best developer plugins possible. Talk about having your cake and eating it too (that saying makes no sense).

internet, technology , , , , , , , , , , ,

Javascript Tip: getElementsByID

March 17th, 2008

Browsers do a lousy job of providing an interface to the HTML document. The DOM is supposed to be that interface but it is horribly slow, and clunky. Traversing the DOM tree extensively is one of the sure-fire way to slow down your site. In an effort to help out Javascript coders, the DOM does have functions like getElementsByTagName, getElementsByClassName and getElementsByName, but they do not all work across all browsers. This why you should create a function called getElementsByID:

var groupCache = {};
function getElementsById(id){
  if(!groupCache[id]){
    groupCache[id] = [];
  }
  var nodes = groupCache[id];
  for(var x=0; x<nodes .length; x++){
    if(nodes[x].id != ""){
      nodes.splice(x, 1);
      x--;
    }
  }
  var tmpNode = document.getElementById(id);
  while(tmpNode){
    nodes.push(tmpNode);
    tmpNode.id = "";
    tmpNode = document.getElementById(id);
  }
  return nodes;
}

Now whenever you want a collection of DOM objects, just give all of them the same id and call this function to grab an array of the objects you want. This is not the most ideal way and its actually a pretty big hack. But sometimes, speed is more important than form.

programming , , , , , , , , , , ,