Forum Moderators: open

Message Too Old, No Replies

Cross browser scripting: Is it worth it?

         

ArrTu

7:16 am on May 31, 2004 (gmt 0)

10+ Year Member



Recently I have found myself using css more and more to script my pages, to the extent that in some instances the css document is larger than the HTMl document that uses it!

At roughly the same time, I was introduced to a programme which proof reads a css document and lists its compliance and highlights any browser clashes.

To this end I finally got round to downloading NN7 wheras in the past I have ignored it as IE is the browser most people have, right?

Imagine my horror when I browse through a half dozen sites to find that my formatting is incorrect. In some instances only marginally, but in places where I have used a z-index negative number, enough to make the whole thing cluttered and clumsy.

Obviously now that I am aware of this I will do duplicate pages for cross browsing off the back of a browser redirect, but the point is (yes there is one):

Is it really worth it? Where do you stop? Do you then worry about the minority that use browsers other than NS and IE, and cater for them too? Surely a line has to be drawn somewhere? Thought and opinions please.

TheDoctor

11:08 am on May 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ArrTu, if you produce css to w3c standards then you will, more or less, cover all bases. Test in Mozilla, then do any tweaking to accomodate IE users. (It is easier to produce w3c-standard CSS and then tweak it to be IE-compliant than to produce IE-compliant CSS and then try to make it fit the standards as well).

If you do this, then your cross-browser problems will reduce to a few well-known (but frustrating) situations, which are well-documented in this forum.

(Oh, and remember to hide the more complicated stuff from the few NN4 users by means of @import or similar. There aren't many NN4 users, but the one that comes to yor e-commerce site might just be an eccentric millionaire, so don't drive them away for the lack of a small, one-off bit of code ;))

Allwebco

8:18 am on Jun 1, 2004 (gmt 0)



Figured I throw my two cents in on this one...

I actually use Opera for most of my web surfing. I've found it to be far more stable, it has only crashed on me once or twice, and doesn't take up space in my task bar (Unlike the billions of little windows you'll have open when using IE!) But of course since it's not that common of a browser I run into quite a few sites that don't view properly. However this is expected, so I have IE as my backup. I think anyone who uses netscape or an odd ball browser like me expects that they are going to run into sites that they won't be able to see properly. In otherwords...they are the minority so no I don't think it's really worth it to check everything in every browser unless you've got a bunch of free time on your hands, cause I sure don't! But on the other hand, if IE wasn't such a piece of junk just like everything Microsoft makes then everyone would use it and we wouldn't have this problem would we?

DrDoc

3:40 pm on Jun 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In some countries (and for many federal Web sites) it is a legal requirement to not discriminate against any user because of user agent used to view the page...

tedster

4:18 pm on Jun 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



in some instances the css document is larger than the HTMl document that uses it!

Just a guess that the css is inefficient. Here's one approach that has cut my css by a huge factor -- did you know that you can include more than one class at a time, separated by a space? Mark-up like this <p class="l r s"> will apply three classes to the paragraph.

So I declare certain utility classes such as .c {text-align:center;} t {margin-top:2em;} or whatever ingredients I will commonly need in my mix for a given design. Then there's no need for lots of complex classes or IDs.

----

The principle question asked in the beginning of this thread is "is it worth it". That's a business decision. So let's look at some numbers. IE represents in the area of 75% to 85% of the potential traffic. Let's be generous and say 85%

What is it worth it to increase sales by 15% -- no, let's say 10% and assume that the last 5% is going to be a whole lot of trouble. So, what investment in time and resources would be justified if it meant an ONGOING increase of 10% in sales?

I think the answer is pretty clear - a 10% increase in sales, ongoing, is pretty huge.

DrDoc

4:25 pm on Jun 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well said, tedster! When you look at it that way... it seems really obvious, doesn't it?

ricfink

9:04 pm on Jun 1, 2004 (gmt 0)

10+ Year Member



Drdoc said:

"In some countries (and for many federal Web sites) it is a legal requirement to not discriminate against any user because of user agent used to view the page... "

Could you elaborate on that? For instance, let's say I've set sizes in CSS using pixels. Opera and Moz, for instance, have CSS-independent Zoom features so users can resize the text to suit themselves. However, IE/Windows with, by far, the biggest user base, doesn't.

Is that discrimination by some country's standards?
In other words, am I bound by law to use ems and percentages in some countries?

I'd really like to know what you're referring to.

DrDoc

9:08 pm on Jun 1, 2004 (gmt 0)

ricfink

1:01 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



thanks for the refs, dd.

pixelkat

5:44 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



ArrTu wrote:
"Recently I have found myself using css more and more to script my pages, to the extent that in some instances the css document is larger than the HTML document that uses it!"

That is as it SHOULD be, ArrTu. I don't want to alarm anyone, but HTML is going away. I'd be surprised if our html pages are more than a few lines long within the next couple of years. The font tag, center, and even our trusty img tag have already been deprecated, which means they will be unsupported in future generation of browsers in a year or so. I predict tables will be next, which is why it is so important that we all wean ourselves from them now by switching to the CSS Box Model.

All of my CSS documents are now 3 - 5 times longer than my average HTML documents. I don't hardly even use JavaScript anymore now that CSS will do mouseovers, slideshows, tooltips, and a huge variety of dropdown menus.

The beauty of driving web sites with CSS instead of HTML is that you can write one stylesheet to control a desktop version, a handheld or cellphone version, a Braille-reader version, etc, and in the imminent future, a bevy of other new platforms, ALL WITHIN THE SAME STYLESHEET. The first time I opened up one of my desktop web sites on my PocketPC handheld device, to see a perfect miniature scaled version of the desktop model, I absolutely went wild with excitement!

All of this would not be possible without w3c standards for not only browsers but for all other content-driven technologies. It's not about Mac vs PC anymore. It's about desktop computers, pda and mobile devices, set-top boxes for TV, game consoles, kiosks, electronic billboards, you name it! ...each with its own protocols and peculiarities.

it's not even just about Microsoft vs Netscape anymore. Now it is Microsoft vs everybody else. With MSIE becoming the laggard in browser innovation and standards compliance, as well as its continuing development of proprietary solutions that only play in its own products, just how long do you think Microsoft will maintain its dominate over the browser market, much less anything else if it persists in playing by its own rules?

Microsoft may have won the end-user, consumer market browser war, but when whole industries and multinational corporations like Boeing, where IE is strictly forbidden because of security issues, and American Express run Netscape/Mozilla on their networks for better security, you better believe we must continue to develop cross-browser solutions!

Even with regards to the consumer market, when you consider the 180,000+ well-paid Boeing consumer-workers, for example, with money burning a hole in their pockets, who shop for personal items online at work, that's 180,000 possible sales opportunities missed for any IE-only site because it's mangled in Netscape on any Boeing workstation computer! Worse yet, because Boeing still supports Netscape 4 on its computers, an IE-only site might not appear at all!

IE winner of the so-called browser war? I THINK NOT! Cross-browser scripting worth it? You bet! Our livelihood as web developers depend on it!

BillPosters

7:51 pm on Jun 2, 2004 (gmt 0)



Could you elaborate on that? For instance, let's say I've set sizes in CSS using pixels. Opera and Moz, for instance, have CSS-independent Zoom features so users can resize the text to suit themselves. However, IE/Windows with, by far, the biggest user base, doesn't.

I can't see any way that you could be accused of discrimination because any/all site's that youown/produce use px to size text.

The W3C standard for CSS recommends that the UA enables the suer to override author font sizes.

Given that W3C are setting the standards which many governments use as the yardstick for legal compliance with their accessibility legislation, it is highly unlikely that anyone following the standard would have a case to answer.

The use of (css) px to size text is amongst the recommendations of that standard.
MSIE/Win's unique failure to meet that recommendation means that it is sub-'standard'.

As a result, it is more likely that the 'blame' could be passed down the line to MS, for their failure to meet that recommendation.

There is also the argument that a browser is a tool of choice and as such, the user would bear some responsibility for the problems they are experiencing (v-a-v resizing px fonts) through their choice/decision to use MSIE/Win rather than one of the other superior, more compliant browsers which are freely available.

Given MSIE/Win's failings, using px fonts might not be the most user-friendly thing you can do, but it surely won't be breaking any anti-discrimination laws.

Of course, depending on the nature/purpose of your site, the anti-discrimination legislation may not even apply to you.

victor

8:56 pm on Jun 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



a 10% increase in sales, ongoing, is pretty huge.

And it could be much better than that, tedster.

Imagine 10 sites each attempting to sell 100 widgets a day. But they are all turning away 10% of their daily sales because they don't support minority browsers or accessility issues.

That's 100 widgets sales a day going somewhere. The first of the 10 sites that addresess the issues could pick up all all them. That's nearly double the business.

R1chard

5:10 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



^ Yeah, the above is sense.

Imagine you just bought a new album, and it said "This CD only works on Panasonic players". I guess you have a Sony and can't listen to it... So is that worth it?

[edited by: tedster at 7:13 pm (utc) on June 3, 2004]

ArrTu

9:50 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



What I don't get, and I believe it all boils down to this : *whisper* browser snobbery. I had this discussion with a friend and he said "oh but netscape is so much cleaner and pure and clinical than ie".

"so?" says I "your point is? IE covers a multitude of sins, it allows the programmer to get away with murder. What is with the billgatesophobia?."

I ask, how many people do you think REALLY care what browser they are using. If 90% of all purchased PCs run microsoft operating systems which includes internet explorer, what possible reason does anyone have to change it? Ask joe public what browser he uses and I bet the answer you get is "what WHAT am I using?"
he doesn't know and doesn't care. Meanwhile, in our world, we have people suggest we programme our pages for compliance with netscape, because if it is alright in netscape it will be alright in IE. Isn't that just "dumbing down" by any other name? If IE offers so much more potential, why is that potential discarded as unimportant because it is "non-compliant". Here is a rather sensational thought: What if.... microsoft....are visionaries! They have shown us a path where so much more is possible. If we live out our lives just to conform then we have lost our sense of adventure. Brother, sister programmers, throw off the shackles of subserviance to the minority and be adventurous. See the brave new world that exists beyond the snobbery of browser compliance and accept that just because they say it isn't in the rules doesn't mean it isn't right.
I give you the immortal words of Gene WIlder's Willy Wonka: "We are the music makers, and we are the dreamers of dreams." (Arthur O'Shaughnessy)

ArrTu

9:55 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



"I don't want to alarm anyone, but HTML is going away. I'd be surprised if our html pages are more than a few lines long within the next couple of years."

indeed. I looked up, out of posterity a book I have on HTML3.2 (which should have gone to a charity shop long ago) and approximately 75% of the book could go straight in the bin. It mentions CSS as a tool to assist in page formatting.

I look forward to HTML being thrown in the bin completely because it has outlived its usefulness, there are now better ways. Yet, for years to come, we will all still programme with HTML formatting BECAUSE there might, just might, be someone out there using an old browser. What do we say then? "oh they don't matter because they should conform with modern times"? That's the point im trying to make.

BillPosters

8:44 am on Jun 4, 2004 (gmt 0)



"so?" says I "your point is? IE covers a multitude of sins, it allows the programmer to get away with murder.


The point you and many with that view seem to miss, is that much of the point of x-browser development via web standards is that the 'multitude of sins' that MSIE so willingly handles will sometimes kill a site stone dead in other browsers - including alternative browsers and assistive technologies used by many of those with disabilities.

If you could write a page using a single coding model that works equally well in MSIE, NN, Moz, Safari, etc… and was perfectly accessible/useable to alt browsers and assistive technologies, what benefit could there be to sticking with a blinkered MSIE-centric coding model?

Imho, if offered the choice, only a bloody-minded fool would choose the latter.

MSIE is more than welcome to bolt on additional bells n whistles to their browser.
Site developers are free to use those bells n whistles if they so desire.
No-one is saying otherwise.

What people are saying is that the bells n whistles should be additions to the basic format of the page and shouldn't be the only means of presenting essential, critical information.

We are all free to build our sites however we choose*, but it is better for all involved if we build our sites in a way that scales according to the capabilities of the user's browser.
Build a site that works well on every browser and bolt on the bells n whistles for the MSIE users to enjoy.
(* just as, under certain circumstances, the law is free to prosecute us if we knowingly or intentionally use discriminatory methods to build them)

Web standards isn't about capping a browser's ability to provide experimental features. It's just about ensuring its ability to handle the essential parts of a site according to a model that is designed to make 'the essential content' of a site equally open and useful to the users of both conventional and alternative browsers.

-

Building in support for old, non-compliant browsers is basically a business decision. It can and should be weighed up on those terms.
If NN4 (or any other 'vintage browser) users still represent a significant portion of a site's visitors/conversions then it's in the site owner's interest to maintain support for that browser.
If the Return on Investment (ROI) points out that supporting them is profitable then, if you want their money, you do.

From a legal perspective (re: anti-discrimination legislation), it is extremely unlikely that a site owner/developer will ever be prosecuted for failing to support the idiosyncracies of non-compliant browsers.

With the increasing profile of the web standards body, the 'modern times' to which you refer are by and large already here.
With the construction and promotion of formalised standards the web is experiencing a watershed moment where the past can, and largely will, be consigned to history and the future will be built with greater attention to detail.
Browser developers are now largely on-board the web standards movement so are likely to build their wares in a way that takes into account the slowly evolving set of standards.
The pace of evolution is likely to be sufficiently slow as to ensure that only the chaff is left behind.