Thursday, March 23, 2006

XHTML goodness

Today, I was playing with a bit of DHTML with both Firefox and IE6.
At some point I added an XHTML doctype to make IE observe CSS a little better.
Suddenly, the script dies in Firefox.
error in parsing value for property 'left'. Declaration dropped.
This occures in the javascript that was reading and writing the left style property of an element.
The solution was multipronged.
First, everywhere I was setting the left style property, I needed to ensure that the number was followed with px.
Thus, = foo; gets replaced with = foo + "px";

Next, when finding elements by tag name, change to lower case.
var items = elem.getElementsByTagName("LI");
get replaced with
var items = elem.getElementsByTagName("li");

And finally, of course, ensure the document is valid XHMTL.

Googling found many people with this or a similar problem but, no solutions.

BTW, add the doctype header really made Firefox and IE6 treat CSS almost the same.
"-//W3C//DTD XHTML 1.1//EN"

Just an interesting note to add.
The tagName property of a node still returns uppercase.

Links to this post

Wednesday, March 22, 2006

Logging user activity with javascript

I've scribbled up an old article on logging with javascript.
Comments can be added here.


Links to this post

FTP Shell script

This post is just to collect comments and feedback on the FTP shell script at:

I notice that the majority of visitors are from Brazil, France, Germany, Italy, Romania, Tawain, and the United Kingdom. So, I am sure the first improvement will be just to translate the page.

I would appreciate hearing about experiences, successes and failures.

Links to this post