Frinavale 9,735
Recognized Expert Moderator Expert
This thread has been split off of the thread about how to align a table in the middle of the page.
@David Laakso:
I finished reading the article and it made me look into using expressions in CSS. Although the author's solution was pretty neat I'm going to avoid using it. There are a few reasons for this decision:
The first reason is because expressions are proprietary to Internet Explorer and so they are not going to work in other browsers.
The second reason is because expressions were made available in IE5 but are no longer supported in IE8. One of the nice things about IE8 is that they are trying to become more standards complaint; but this means that stuff like expressions had to go.
Another reason is because I'd be combining JavaScript into my CSS styles. This could possibly open the website to a cross site scripting attack which may be over looked.
Also, expressions evaluation has a high runtime cost. Apparently they evaluated when the page is rendered, resized, when the page is scrolled, and even when the user moves the mouse over the page!
I'm glad that you opened my eyes to the possibility of dynamic CSS solutions; however, I'm going to stay away from using CSS expressions.
Thanks!
-Frinny
7 3380
I finished reading the article and it made me look into using expressions in CSS. Although the author's solution was pretty neat I'm going to avoid using it. There are a few reasons for this decision:
Just for clarification:
The first reason is because expressions are proprietary to Internet Explorer and so they are not going to work in other browsers.
IE "expressions" are fed only to, and only seen, by non-compliant browsers IE/6 and down using "conditional comments" [1]. Compliant browsers do not need to be fixed, nor does IE/7.0, nor will the forthcoming IE/8.
[1] http://reference.sitepoint.com/css/conditionalcomments
One of the nice things about IE8 is that they are trying to become more standards complaint; but this means that stuff like expressions had to go.
Please see above.
Another reason is because I'd be combining JavaScript into my CSS styles. This could possibly open the website to a cross site scripting attack which may be over looked.
That the inclusion of the DHTML used in IE "expressions" could possibly "open the website to a cross site scripting attack" is slim to none.
Also, expressions evaluation has a high runtime cost. Apparently they evaluated when the page is rendered, resized, when the page is scrolled, and even when the user moves the mouse over the page!
The load time using "expressions" is a very slightly slower than using a pure javascript solution. However, this is far outweighed by a much smoother less page jolting experience for users than that offered by a pure js solution.
I'm glad that you opened my eyes to the possibility of dynamic CSS solutions; however, I'm going to stay away from using CSS expressions.
CSS deals with the way stuff looks, not its behavior. With "expressions" you are attaching DHTML in order to make IE/6 and down behave as compliant browsers.
A decision not to support IE/6 is up to you and your client. Not all authors and clients have that luxury. Regrettably, IE/6 will be around for some time to come even after the release of a stable IE/8. However, current thinking among some is that the time to provide IE/6 with pixel perfect emulation of compliant browser rendering are long gone...
The first reason is because expressions are proprietary to Internet Explorer and so they are not going to work in other browsers.
The beauty of them is, only IE gets the penalty of using them, and the other browsers don't need it anyway. I've used expressions (not too many on any one page) for a few things for IE6 alone. 60% of my visitors will never load the expression-- they're using IE7 or a modern browser (I don't have an expression for display: table but I would consider one if I found it-- IE8 understands display: table AND has lost the Haslayout thing, so it wouldn't need the crutch either). Those who do load the expression give their inferior browser a helping hand. Some IE6 folks might have their security settings at the High level (a good thing if they can't switch browsers and are worried about security), and they don't get the expressions (just as they don't get any Java-junk anyway). They simply get a degraded experience. My rule, I think most web developers' rule, is that the site just needs to be readable and functioning, nothing more, for these people.
An expression is a crutch for the crippled. You don't say, grandpa doesn't get his wheelchair because it doesn't help his relatives. Only grandpa needs it, and only grandpa gets it.
There's another way to give scripts to IE alone-- a .htc file sitting on your server like Peterned's whatever:hover or that Edward Dean IE7 script thingie. You can try to make that file as secure as any on your server. It's your file and your server. : )
If you know Shelley Powers, as of January 2010, she refuses to give crutches to grandpa, err IE, of any kind. If IE can't run a current, standards compliant markup, too bad.
Shelley Powers? That poor thing can't make a site that works properly in a compliant browser.
Have you been there lately? I hadn't till just now. I don't know if she sends different content to IE but she serves XHTML as application/xml+xhtml but she does have some errors in it. I don't know if it's because she's sloppy or because she runs on the bleeding edge.
She works down the street from me so I have to give her props. :)
Oh she's fine. Talented, knowledgeable, and on the cutting edge. I was just trying to stoke the stove. But April is almost here.
Yet even more trivial pursuits:
This is an IE expressions discussion. Not a CSS expressions discussion.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Raymond Hettinger |
last post by:
Peter Norvig's creative thinking triggered renewed interest in PEP 289.
That led to a number of contributors helping to re-work the pep details
into a form that has been well received on the...
|
by: zipher |
last post by:
It seems the debate over PEP 308 (if-then-else expression) occurred
prior to the arrival of generator expressions.
Mightn't this new latter syntax be the ticket to a "one obvious way"
to write a...
|
by: tony kulik |
last post by:
This code works fine in ie and opera but not at all in Mozilla.
Anybody got a clue as to how to get it right?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script...
|
by: me |
last post by:
How do I prevent the save/print/email/mypictures toolbar from popping up
when IE users place their cursor over photos at my website? Thank you in
advance for your help.
Signed,
me
|
by: William L. Bahn |
last post by:
===========
(N869, p8) An object is a region of data storage in the execution
environment, the contents of which can represent values.
When explaining this to students, is it reasonable to say...
| |
by: nimmi_srivastav |
last post by:
Below you will see an example of a nested conditional expression that
this colleague of mine loves. He claims that it is more efficient that
a multi-level if-else-if structure. Moreover, our...
|
by: Neroku |
last post by:
Hello, i would like to know what the serious definition of statements
and expressions is:
i know an expression are evaluated to a value, i.e:
1 == 2
5+7
foo( 1,2)
and a statement is...
|
by: Wiseman |
last post by:
I'm kind of disappointed with the re regular expressions module. In
particular, the lack of support for recursion ( (?R) or (?n) ) is a
major drawback to me. There are so many great things that can...
|
by: RobG |
last post by:
There has been a discussion on the iPhone web development group where
an opinion has been expressed that function expressions are bad for
performance and can be avoided by using function...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |