HTTP servers should be more browser aware.

Cogman

Lifer
Sep 19, 2000
10,286
145
106
I'm sick of all the crappy hackery that has to go into CSS and javascript code to be cross browser compatible. What we need is for Http servers to be smarter. I should be able to create like this

test.css
test.css.IE
test.css.chrome
test.css.firefox

and have the web server automatically pick the right one based off of the browser data. Heck, browser already send browser identification information to the server, why not use it?

Code:
#wrapper {

  border: 10px solid black;

  width: 770px; /* IE5.x/win sees this.. */

  voice-family: "\"}\"";

  voice-family: inherit;

  width: 750px; /* ..but not this "standards" width value.. */

  }

Rather than having some bloated thing like this, why not have clean CSS written for the specific non-compliant browsers.

Now, it is true that you'll have multiple versions of the same files, however, I think that is vastly easier to deal with than having one file filled with 500 different hacky things per element.

Same can go with javascript stuff. It should be able to be more modular. Build the base functions to work with different browsers and the upper layer to deal with the base functions. Right now, javascript is more like "Throw every function into one big file".
 

Fallen Kell

Diamond Member
Oct 9, 1999
6,208
537
126
Here is a better idea. Why don't all the crappy browsers out there implement the actual CSS, Javascript, or HTML "STANDARDS"!!!! That way NO ONE would have to deal with that crap, other than the people who write the standards and the people who decide to incorporate the standards in their products?
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Here is a better idea. Why don't all the crappy browsers out there implement the actual CSS, Javascript, or HTML "STANDARDS"!!!! That way NO ONE would have to deal with that crap, other than the people who write the standards and the people who decide to incorporate the standards in their products?

This is never going to happen. We can keep harping about it, complain about it, and moan about it. But 3rd parties made it so 3rd parties control it. IE5, 6, and 7 are so prolific, even today, that we just can't reasonably expect MS to "fix" it. Or even for the IT managers to implement the fixes.

This solution is one that mitigates the problem.

And don't get me wrong, I would love to see IE5, 6, 7, and even 8 to some extent, die or be fixed. But that just isn't going to happen.
 

Train

Lifer
Jun 22, 2000
13,587
82
91
www.bing.com
I'd rather not have a built in server feature to do this.

Why not just handle it yourself? Instead of linking to test.css, link to test.php or .aspx or .jsp or whatever?

Generate the css on the fly, customized to the browser tag.

Theres actually 3rd party libs that already do this.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
So now it would be up to the server maintainers to update their code every time a new browser comes out? What about those who run esoteric browsers or run an extension that alters the outgoing headers?

Seems just like even more things to add to the confusion.
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
I'd rather not have a built in server feature to do this.

Why not just handle it yourself? Instead of linking to test.css, link to test.php or .aspx or .jsp or whatever?

Generate the css on the fly, customized to the browser tag.

Theres actually 3rd party libs that already do this.

Seems like the best idea here. Shouldn't require that complicated a script in ASP.net or PHP, and with a little htaccess trickery you could have the files divided up per browser like you have listed, and have the server toss back the appropriate one on a request for the css file. A little bit of .htaccess voodoo and the client shouldn't even know it's anything other then a plain-Jane css file.

Wonder how reliable user agent strings would be.
 

BigDH01

Golden Member
Jul 8, 2005
1,631
88
91
I'd rather not have a built in server feature to do this.

Why not just handle it yourself? Instead of linking to test.css, link to test.php or .aspx or .jsp or whatever?

Generate the css on the fly, customized to the browser tag.

Theres actually 3rd party libs that already do this.

This seems like a lot of effort when what people are basically talking about is fixing IE. IE, however, already gives you the capability to easily download specific css files. Outside of IE, getting cross-compatibility is usually fairly easy. If you are working with mobile devices... you should probably be using a separate website anyway.
 

Aluvus

Platinum Member
Apr 27, 2006
2,913
1
0
First of all, just stop using hacks like that in your CSS. You're doing it wrong.

Second of all, we already have the ability to do this. The problematic versions of IE support conditional comments. These allow you to insert instructions (like, say, include this special IE-fixing CSS file) that IE will process and all other browsers will treat as ordinary comments. Other browsers (including modern versions of IE) simply shouldn't need specialized CSS, but if needed then PHP, JavaScript, or your language of choice provides you with adequate tools to do it.

Cross-browser compatibility is and has always been unpleasant; but it is not remotely as horrible as it was just a few years ago.

And don't get me wrong, I would love to see IE5, 6, 7, and even 8 to some extent, die or be fixed. But that just isn't going to happen.

IE 5 in every horrible flavor is already dead and buried, and 6 is well on its way out. 7 is workable from a standards perspective; 8 is better and already makes up a majority of IE marketshare in some statistics.