Monday, December 19, 2005

Internet Explorer 2 X 1 Firefox (and the game is still on)

Looks like a series, huh? Well it was not my intention, but here it is.

A few days ago I complained about the fact that I needed to write twice as much code in Firefox than I needed in IE.

Today I discovered something else. Subtle, but it can be extremely annoying.

Do you see the List of Articles I wrote on the left side of the page? It's updated automatically from an XML file that holds the article titles and a small description of each article. Just reload this page and you'll see the "Reading..." message while the list is updated.

So, that's the problem. Due to a small misconfiguration on 50webs.com servers the XSL file that contains the transformation rules from XML to HTML is sent from their servers with a mime-type of "text/plain" instead of the correct "text/xml".

IE reads both just fine. However, Firefox doesn't.

On my server, the configuration was done automatically and I didn't need to worry about it. I just came across this odd behavior of Firefox because the code that worked when I was looking at the page hosted on my test server was not behaving as expected when the page was rendered from the server.

At first I thought it could be some problem regarding safety issues, once my test server is "localhost". I knew that Firefox was loading the right file, but maybe it was some distortion when the file was downloaded from 50webs server.

So I opened the XSL file on Firefox... and discovered the error.

The solution, or should I say workaround, was simply rename the file to have an XML extension instead of the proper XSL.

I've sent a note to the guys at 50webs and hopefully they will adjust their server configuration.

It's easier than requesting the Mozilla to fix their code.

0 Comments:

Post a Comment