zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    用学习逃避成长,听新知缓解焦虑
    谈谈“人”和“技能”
    SpringMVC的工作原理
    Spring MVC 处理静态资源文件
    nrpe的安装设置
    Maatkit工具使用<一>之mysql主从数据校验工具
    phpcgi占用cpu100%的一次排障之旅
    nginx支持cgi
    如何查看服务器RAID卡信息的SHELL脚本和命令介绍
    Mysql的一次经典故障
  • 原文地址:https://www.cnblogs.com/kakrat/p/2071921.html
Copyright © 2011-2022 走看看