SuperSaiyan

I do all aspects related to high performance distributed web application system, such as RIA, Security, databse design and sql, javascript, c#, Asp.net, Software Factory. Among these, the database part is the key to performance.

导航

统计

A small breaking change in IE8 causing big pain in the ass: the default type of button element

The default type of button element is 'button' before IE8 (default means when you do not explicitly specify a value for the type property). However, in IE8, Microsoft decided to comply the w3c standard, thus the default type of button is changed to 'submit'. This costed me so much time that I started to hate w3 in a certain way.

So you may ask, why?

If the default button type is 'button',  the old Microsoft way of doing things, which is also what everybody will naturally think it should be, then clicking a button will only raise a click event, but if it is 'submit', it will cause the form in which the button resides to submit the form to server. This is big difference.

 

If this breaking change only occurred in a different situation, it would not have costed me so much time. But, it emerged on a very complex page. The page lists the pictures the user has uploaded so far, but the pictures are all hosted from a different domain than the page's own domain. The page also lets user to upload new pictures and edit existing pictures' properties, but all to that resource server. So it is a very complex cross frame, cross domain page. When the breaking change was causing bug in the page,  the page's complexity lead me to the wrong dirrection when I was trying to resolve this bug. Thus it costed me a lot of time.

 

So your guys watch out this breaking change of the default type of button element in IE8. Note chrome and firefox all have similar behavior as IE8.


The discrepancy in browsers is a big pain for every web developers. So people like standard, but in the case of web developement world, there are two standards, the de facto standard, which is Microsoft's internet explorer, and the official standard, the w3c standard. So you have two standards to deal with. Now that for each web page, I have 5 browsers to have it tested with, the IE6,I E7, IE8, and chrome, firefox 4. I set up virtual machine for this.

 

Btw there is a new virtual machine of IE9/Win7 from Microsoft to download.

 

posted on   SuperSaiyan  阅读(385)  评论(0编辑  收藏  举报

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述
点击右上角即可分享
微信分享提示