Jean-Jacques Halans ‹› Afterhours

Archive for the ‘Development’ Category

Web Directions South 08

Wednesday, June 11th, 2008

In little over three months the web development highlight of the year is back in town, Web Directions South 2008, the biggest web conference in the southern hemisphere. Great workshops, fantastic speakers from Australia and around the world, and overall a fabulous social gathering of like-minded souls.

Some name dropping: Douglas Crockford, Jina Bolton, Jeffrey Veen, Daniel Burka, Derek Featherstone, and many, many more.

Get in on the action early to get the early bird pricing, get in late and you might miss out!

Ajax, 2 candles

Sunday, February 18th, 2007

Today we have cake, a birtday cake with two candles. Hip hip for Ajax. It’s been two years already since Jesse James Garrett posted his seminal essay, "Ajax: A New Approach to Web Applications". And the web has changed since then, into what we call Web 2.0 today. Of course it’s only a simple, one-word name for a collection of different techniques already in use for a while by different sites. Still having one defining (and often misused) term for a technique to create a new, richer web inspired a new wave of interactive, social websites. We are only at the beginning of a new chapter of the brief history of the Internet, but the name Ajax will be printed in bold in it’s first paragraphe.

Congrats CSS!

Tuesday, December 19th, 2006

It’s 10 already!
"In 2006, the World Wide Web Consortium proudly celebrates the ten years of Cascading Style Sheets (CSS), the technology designers use to create attractive, economical, and flexible Web sites. In these pages you will find history and highlights from 10 years with style."
CSS10 – The pressrelease

Tools of the trade

Friday, November 11th, 2005

Some tools

  • KDiff3
  • Sepy Actionscript editor
  • IE Drip
  • CSSVista
  • IE Webdeveloper toolbar
  • Firefox webdeveloper extension
  • FontHit Fonttools
  • Agent Ransack
  • dbPowerAmp music converter
  • ColorPix color schemer
  • SC Unipad
  • Riva FLV encoder
  • WinSCP
  • WinCVS
  • TortoiseCVS
  • RapidSVN
  • TortoiseSVN

DOM scripting gotcha’s (1)

Monday, October 31st, 2005

Started working on a new project with a new colleague the other day, and we decided to use JSON to handle the data client-side and standard W3C DOM scripting to represent the data, because all modern browsers support it (for about 95% that is), right?

During development we encountered those other 5% of which support was flawed, in Internet Explorer 6 (the usual suspect) and Firefox, the kind of things you most likely don’t read about in the books (well, I haven’t). This entry is just a write-up of those problems and their solution.

Extra textnodes

Let’s not start with the usual suspect IE, but with a genuine Firefox bug (Bugzilla Bug 26179). DOM has some read-only properties to traverse the node tree, like firstChild, lastChild and childNodes. This last one returns an array of childnodes for a specified node, and therefore you can also call the length property of this array. In our case, this resulted in a difference in length between IE and Firefox. What was going on here (tip: source formatting)?

We had a table (the proper way, for representing tabular data) with a tbody, and tr/th/td elements. If you don’t add a tbody element yourself, the browser is so kind to add one herself, which is in fact the standard behavior, so no finger-pointing here (again, if you didn’t take this into account during your DOM scripting, you might get another result than expected because of the browser adding a tbody element). We knew how many elements we had for the tbody parent, still there was a difference of 2 between IE and Firefox. This is where you need a DOM inspector. You get one in Firefox (included in the install) and you can get another one for IE (if you don’t have one yet, get the Microsoft Web Developer toolbar which includes a DOMi).Our table code was formatted as followed (simplyfied):

<table class="myclass">	<tbody id="me">		<tr class="otherclass">		<td class="tdstyle"></td>		<td class="tdstyle"></td>		...		</tr>	</body></table>

Because of this nicely formatted source code, Firefox adds additional textnodes, rendering the childNodes property useless for scripting. This is an example, try it with Firefox and IE. If you click the links, you’ll get the childNodes array lenth. Then also check the page using the DOM inspector for either browser.
This is the Mozilla explanation/solution.
My solution woul be to remove the whitespaces between tag, and format the source code differently, something like:

<table ... class="myclass"><tbody 	id="me"><tr 		class="otherclass"><td 		class="tdstyle">...</td><td 		class="tdstyle">...		</td></tr></tbody></table>

You get the idea, I guess.

Non-breaking space

I needed to add some blank content to a table cell, which would later then be replaced by actual content, Normally we would use a &nbsp; HTML element. WIthout content the table cell isn’t styled properly. To add this using domscripting you need to use the createTextNode, but using "&nbsp;" as its text content, it would be HTML encoded, being displayed exactly like that, &nbsp; You need to use the Unicode variant (\u00a0), ex. as followed:
document.createTextNode("\u00a0");

DOM Scripting gotcha’s (2)

Monday, October 31st, 2005

And last but not least: an IE memory leak

Here’s an MSDN article about IE ‘leak patterns’. I guess they are IE ‘features’, and not bugs…
Use Drip to find any IE leaks.

http://outofhanwell.com/ieleak/index.php?title=Main_Page

Some other references here,

Dreamweaver tip

Friday, August 12th, 2005

Yesterday I went to a MMUG meeting for a presentation on the new Flash 8 and Dreamweaver 8. Dreamweaver 8 now has code collapsing features, as Homesite used to do. Homesite also had code splitting, which allows you to split the page code view into two parts, so you can compare parts in the header with parts further down, without scrolling back and forth. I had already seen that this feature wasn’t included in the new version, but someone did pop the question. The guy from Macromedia had a great tip for codesplitting in Dreamweaver, which has been available for a while now in Dreamweaver:

There is a panel called ‘Code Inspector’, which is just another view on the code. Open the panel through the ‘Window’ menu, then dock this panel below the main view (Code/Design view), above the Properties panel, et voila, you have codesplitting, almost the same as in Homesite.

Brilliant tip.

Greasemonkey

Wednesday, July 20th, 2005

I love Firefox and its extensions, and I’m pretty interested in the Ajax developments. Recently a Firefox + Greasemonkey extension vulnerabilty surfaced. This vulnerability could allow an evil server to read the contents of your harddisk, if you have Firefox with the Greasemonkey extension installed, using XMLHttpRequest to send the data in the background to the server. The community was quick in deploying workarounds. One of them was Flickr, who implemented a notification script on its pages warning Greasemonkey users of the vulnerability. If you too are a Greasemonkey user, you might get a warning on this site as I took over the script from Flickr.
Read more on the Greaseblog, or here for more details on the vulnerability.

Ajax − Asynchronous JavaScript and XML

Thursday, February 24th, 2005

Interesting write-up about a technique they call ‘Ajax’, which is :

  • - standards-based presentation using XHTML and CSS;
  • - dynamic display and interaction using the Document Object Model;
  • - data interchange and manipulation using XML and XSLT;
  • - asynchronous data retrieval using XMLHttpRequest;
  • and JavaScript binding everything together.

Think of GMail, Google Maps, Google Suggest, Flickr. A technique I have used myself a couple of times over the last few years, although not for a complete app, but some parts of it.
Read it at Adaptive Path.
And have a look at my ajax resource page.

Site search

You are currently browsing the archives for the Development category.

© 1997-2010 Jean-Jacques Halans - Less is more | All content CC | Log in  

Jean-Jacques Halans Afterhours is proudly powered by WordPress
Entries (RSS) and Comments (RSS).